Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
OrlaH
 
Posts: n/a
Default create & name multiple worksheets

Hi:
I have a row of 20 numbers.
I want to create a worksheet for each number and name the worksheet after
that number.

I have a little exposure to macros.

OrlaH
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default create & name multiple worksheets

like this?
Sub newsheets()
For i = 4 To 24
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
Hi:
I have a row of 20 numbers.
I want to create a worksheet for each number and name the worksheet after
that number.

I have a little exposure to macros.

OrlaH



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
OrlaH
 
Posts: n/a
Default create & name multiple worksheets

thanks for the response Don,

I'll try that. The only thing is my range of numbers is not sequential,
e.g. 13, 16, 43, 55. The numbers will always be in a set column, i.e. A:A so
how do I replace the "for i = 4 to 24" with what I want. Would for i = A:A
work?

Kind regards
OrlaH

"Don Guillett" wrote:

like this?
Sub newsheets()
For i = 4 To 24
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
Hi:
I have a row of 20 numbers.
I want to create a worksheet for each number and name the worksheet after
that number.

I have a little exposure to macros.

OrlaH




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default create & name multiple worksheets

You could use this but then you would have to sort the sheets so use the 2nd
one.
Sub newsheetsfromlist()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For Each i In Range("a2:a" & lr)
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

use the one below
Sub newsheetsfromlistBottomUp()
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 2 Step -1
Sheets.Add
ActiveSheet.Name = .Cells(i, "a")
Next
End With
End Sub

or probably BEST
Sub newsheetsAfter()
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
For i = 2 To lr
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = .Cells(i, "a")
Next
End With
End Sub


--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
thanks for the response Don,

I'll try that. The only thing is my range of numbers is not sequential,
e.g. 13, 16, 43, 55. The numbers will always be in a set column, i.e. A:A
so
how do I replace the "for i = 4 to 24" with what I want. Would for i =
A:A
work?

Kind regards
OrlaH

"Don Guillett" wrote:

like this?
Sub newsheets()
For i = 4 To 24
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
Hi:
I have a row of 20 numbers.
I want to create a worksheet for each number and name the worksheet
after
that number.

I have a little exposure to macros.

OrlaH






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
OrlaH
 
Posts: n/a
Default create & name multiple worksheets

tremendous Don. thanks for all your help.

"Don Guillett" wrote:

You could use this but then you would have to sort the sheets so use the 2nd
one.
Sub newsheetsfromlist()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For Each i In Range("a2:a" & lr)
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

use the one below
Sub newsheetsfromlistBottomUp()
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 2 Step -1
Sheets.Add
ActiveSheet.Name = .Cells(i, "a")
Next
End With
End Sub

or probably BEST
Sub newsheetsAfter()
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
For i = 2 To lr
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = .Cells(i, "a")
Next
End With
End Sub


--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
thanks for the response Don,

I'll try that. The only thing is my range of numbers is not sequential,
e.g. 13, 16, 43, 55. The numbers will always be in a set column, i.e. A:A
so
how do I replace the "for i = 4 to 24" with what I want. Would for i =
A:A
work?

Kind regards
OrlaH

"Don Guillett" wrote:

like this?
Sub newsheets()
For i = 4 To 24
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
Hi:
I have a row of 20 numbers.
I want to create a worksheet for each number and name the worksheet
after
that number.

I have a little exposure to macros.

OrlaH








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett
 
Posts: n/a
Default create & name multiple worksheets

glad to help

--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
tremendous Don. thanks for all your help.

"Don Guillett" wrote:

You could use this but then you would have to sort the sheets so use the
2nd
one.
Sub newsheetsfromlist()
lr = Cells(Rows.Count, "a").End(xlUp).Row
For Each i In Range("a2:a" & lr)
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

use the one below
Sub newsheetsfromlistBottomUp()
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
For i = lr To 2 Step -1
Sheets.Add
ActiveSheet.Name = .Cells(i, "a")
Next
End With
End Sub

or probably BEST
Sub newsheetsAfter()
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row
For i = 2 To lr
Sheets.Add after:=Sheets(Sheets.Count)
ActiveSheet.Name = .Cells(i, "a")
Next
End With
End Sub


--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
thanks for the response Don,

I'll try that. The only thing is my range of numbers is not
sequential,
e.g. 13, 16, 43, 55. The numbers will always be in a set column, i.e.
A:A
so
how do I replace the "for i = 4 to 24" with what I want. Would for i =
A:A
work?

Kind regards
OrlaH

"Don Guillett" wrote:

like this?
Sub newsheets()
For i = 4 To 24
Sheets.Add
ActiveSheet.Name = i
Next
End Sub

--
Don Guillett
SalesAid Software

"OrlaH" wrote in message
...
Hi:
I have a row of 20 numbers.
I want to create a worksheet for each number and name the worksheet
after
that number.

I have a little exposure to macros.

OrlaH








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
Functions across multiple worksheets starlight Excel Worksheet Functions 0 August 10th 05 05:10 PM
Sumif with multiple worksheets Cbh35711 Excel Worksheet Functions 3 August 9th 05 02:49 PM
Printing Multiple Worksheets Linda Excel Discussion (Misc queries) 1 August 8th 05 05:12 PM
Need to have multiple worksheets use a single worksheet storm5527 Excel Worksheet Functions 1 April 22nd 05 11:25 AM
How to print multiple worksheets in one workbook on the same page. rrdiorio Excel Discussion (Misc queries) 2 January 6th 05 11:40 PM


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