#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default macro range

I set my macro up to run on multiple spreadsheets. Unfortunately, the macro
functions are performed for the number of lines in the original spreadsheet.
The macro was recorded using 'ctrl + end' rather than a specific row and
column.

Is there a way to have the macro only apply through 'ctrl + end' ?
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default macro range

Hi,

There are several ways of find the last row, last column but you didn't tell
us what you are trying to find.

Here's 2 ways

Last used column in row 1
lastcol = Cells(1, Columns.Count).End(xlToLeft).Column

last used row in a column
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"tlwhite" wrote:

I set my macro up to run on multiple spreadsheets. Unfortunately, the macro
functions are performed for the number of lines in the original spreadsheet.
The macro was recorded using 'ctrl + end' rather than a specific row and
column.

Is there a way to have the macro only apply through 'ctrl + end' ?
Thanks.

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
macro for a range Fats Excel Discussion (Misc queries) 0 January 6th 10 11:48 PM
Macro deletes row in range, macro then skips the row moved up steven.holloway Excel Discussion (Misc queries) 8 June 11th 08 11:40 AM
macro pop-up to set range? NPell Excel Worksheet Functions 0 April 25th 08 03:48 PM
Name a Range - Macro Danny Excel Worksheet Functions 0 October 14th 05 05:24 AM
Use Range Name in Macro Blue Hornet Excel Worksheet Functions 3 August 13th 05 06:02 PM


All times are GMT +1. The time now is 06:22 AM.

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

About Us

"It's about Microsoft Excel"