#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 361
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 638
Default 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
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
How to write a macro to modify an Excel chart raymondvillain Charts and Charting in Excel 4 July 14th 07 04:38 PM
Modify a Macro Carl Excel Worksheet Functions 1 October 28th 06 10:32 AM
Modify macro to copy to next available row Liketoknow Excel Discussion (Misc queries) 0 August 23rd 06 10:10 PM
How to modify a copy macro EAHRENS Excel Worksheet Functions 4 March 13th 06 06:58 PM
macro: combine / modify date / hilite nastech Excel Discussion (Misc queries) 1 February 5th 06 04:36 PM


All times are GMT +1. The time now is 03:12 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"