Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Modify A Macro
I am using this cose:
For Each sh In SheetList i = i + 1 If Application.Range("SheetNames").Cells(i, 1).Value < "" Then With sh LastRow = .Range("a8").End(xlDown).Row LastCol = .Range("a8").End(xlToRight).Column Set RngToName = .Range("a8", .Cells(LastRow, LastCol)) RngToName.Name = Application.Range("SheetNames").Cells(i, 1).Value End With End If Next sh I would like to set the range of the to A5:P1000 Is there any easy way to make this change ? Thank you in advance. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Modify A Macro
Do you mean you want to hardcode the range for RngToName to A5:P1000?
Untested and without seeing the rest of your code: For Each sh In SheetList i = i + 1 If Application.Range("SheetNames").Cells(i, 1).Value < "" Then With sh Set RngToName = .Range("A5:P1000") RngToName.Name = _ Application.Range("SheetNames").Cells(i,1).Value End With End If Next sh carl wrote: I am using this cose: For Each sh In SheetList i = i + 1 If Application.Range("SheetNames").Cells(i, 1).Value < "" Then With sh LastRow = .Range("a8").End(xlDown).Row LastCol = .Range("a8").End(xlToRight).Column Set RngToName = .Range("a8", .Cells(LastRow, LastCol)) RngToName.Name = Application.Range("SheetNames").Cells(i, 1).Value End With End If Next sh I would like to set the range of the to A5:P1000 Is there any easy way to make this change ? Thank you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to write a macro to modify an Excel chart | Charts and Charting in Excel | |||
Modify a Macro | Excel Worksheet Functions | |||
Modify macro to copy to next available row | Excel Discussion (Misc queries) | |||
How to modify a copy macro | Excel Worksheet Functions | |||
macro: combine / modify date / hilite | Excel Discussion (Misc queries) |