Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
GJR3599
 
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   Report Post  
Trevor Shuttleworth
 
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"