Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub lastrowineachsht()
'On Error Resume Next For i = 1 To Sheets.Count With Sheets(i) 'MsgBox Sheets(i).Name lr = .Cells.Find("*", Cells(Rows.Count, Columns.Count) _ , , , xlByRows, xlPrevious).Row 'MsgBox lr ..Range("B1:M" & lr).Interior.ColorIndex = 16 'Select End With Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "tlwhite" wrote in message ... I would like to perform a macro on multiple spreadsheets with varying numbers of rows. When recording the macro, I used the keystrokes to go to the end of the spreadsheet; however, when I apply the macro to other spreadsheets, it uses a fixed row area. How can I get this to go to the end of the spreadsheet? tlwhite Range("A2").Select ActiveCell.SpecialCells(xlLastCell).Select Range(Selection, Cells(1)).Select Range("B1:M2028").Select Range("M2028").Activate |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Group Excel data in varying length financial periods 4/5 weeks | Excel Discussion (Misc queries) | |||
Web Query from multiple varying length pages | Excel Worksheet Functions | |||
using VB to read in a column of values of varying length into an array | Excel Worksheet Functions | |||
Excel 2003: In a Macro,how to select a variable row length table | Excel Discussion (Misc queries) | |||
extracting data from a text string of varying length | Excel Discussion (Misc queries) |