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. |
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. |
All times are GMT +1. The time now is 12:51 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com