A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

soft-coding lines in a macro



 
 
Thread Tools Display Modes
  #1  
Old March 30th, 2005, 09:51 PM
GJR3599
external usenet poster
 
Posts: n/a
Default soft-coding lines in a macro

I am trying to get a macro to find the last line of data (Ctrl+Shift+Down)
and then go down one line...this keystroking hard-codes the line i have
selected but I need it to be able to run without doing so. Any thoughts?
  #2  
Old March 30th, 2005, 10:28 PM
Trevor Shuttleworth
external usenet poster
 
Posts: n/a
Default

Range("A" & Rows.Count).End(xlUp).Offset(1,0).Select

Change the "A" to a suitable column reference.

This works if there are gaps in the data. If there aren't:

Range("A1").End(xlDown).Offset(1,0).Select

Regards

Trevor


"GJR3599" wrote in message
...
I am trying to get a macro to find the last line of data (Ctrl+Shift+Down)
and then go down one line...this keystroking hard-codes the line i have
selected but I need it to be able to run without doing so. Any thoughts?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th, 2004 12:40 PM
Undo Macro sometimes works and sometimes doesn't. Kait Visio 0 November 24th, 2004 05:55 PM
Keyboard Shortcut Only Runs Part of the Macro Jonnyboy117 General Discussion 2 July 14th, 2004 08:27 PM
Need Entry Point 18 Help On Access Executable File Jeff Conrad General Discussion 26 July 14th, 2004 06:00 AM
Macro command go to last filled cell in column? PatsyB. Setting up and Configuration 1 May 17th, 2004 08:09 PM


All times are GMT +1. The time now is 08:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.