View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mark Ivey[_2_] Mark Ivey[_2_] is offline
external usenet poster
 
Posts: 171
Default Code to create worksheet names based on the values in the selected range

Here is a rough one...

Mark

Sub test()
Dim row As Long
Dim mysheetname As String
Dim myworksheet As String

myworksheet = ActiveSheet.Name

For row = 1 To 4
mysheetname = Cells(row, 1).Text
Sheets.Add
ActiveSheet.Name = mysheetname
Sheets(myworksheet).Select
Next
End Sub





"Mike C" wrote in message
...

Is there any chance someone would know some code that allows me to
create new worksheets with the names of a selection of cells.

So, for example, if I selected the following cells:

Rice
Macaroni
Chicken
Hash Browns

I would like the macro to create four sheets by those names.

Any suggestions would be appreciated.