Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 361
Default Macro Modification

I use this macro to make tables (named ranges).

How can I modify the macro so that it will set the range to A1:I1000 ?

Thanks In Advance.

Sub maketable3()

Dim SheetList As Sheets

Dim RngToName As Range

Dim LastRow As Long

Dim LastCol As Long

Dim NameToUse As String

Dim sh As Worksheet

Dim I As Long



Set SheetList = ActiveWindow.SelectedSheets

For Each sh In SheetList

I = I + 1

If Application.Range("SheetNames").Cells(I, 1).Value < "" Then

With sh

LastRow = .Range("a10").End(xlDown).Row

LastCol = .Range("a10").End(xlToRight).Column

Set RngToName = .Range("a10", .Cells(LastRow, LastCol))

RngToName.Name = Application.Range("SheetNames").Cells(I,
1).Value

End With

End If

Next sh

End Sub


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 Modification - Bob Philips Are You Out There ? Carl Excel Worksheet Functions 2 September 17th 06 01:56 PM
Macro Modification Carl Excel Worksheet Functions 2 August 30th 06 01:53 PM
last modification Chip Smith Excel Discussion (Misc queries) 1 June 19th 06 11:55 PM
Macro modification Hirsch Excel Discussion (Misc queries) 3 May 27th 05 10:21 PM
Macro Modification Help Dmorri254 Excel Worksheet Functions 0 March 4th 05 03:51 PM


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

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

About Us

"It's about Microsoft Excel"