Sheet naming from the cell.

anee_4285

New Member
Joined
Jul 9, 2015
Messages
27
Hello All,

I have the names in the Columns in a sheet1. I want new sheets should be created with the name of cell in the row.

The name should be like this.

Sheet1-aaaa
sheet2-bbbb
sheet3-cccc

I cant each sheet because i have 150 rows.
My request is it should dected how many names it have and have to create a 150 sheets with name in the cell.

aaaa
bbbb
cccc
dddd

<tbody>
</tbody>


Regards,
Anil
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
With your names in Sheet1, run this short macro:
Code:
Sub SheetMaker()
    Dim N As Long, i As Long, ary
    
    With Sheets("Sheet1")
        N = .Cells(Rows.Count, "A").End(xlUp).Row
        ReDim ary(1 To N) As String
        For i = 1 To N
            ary(i) = .Cells(i, 1).Value
        Next i
    End With
    
    For i = 1 To N
        ActiveWorkbook.Sheets.Add after:=Worksheets(Worksheets.Count)
        ActiveSheet.Name = "Sheet" & i & "-" & ary(i)
    Next i
End Sub
 
Upvote 0
With your names in Sheet1, run this short macro:
Code:
Sub SheetMaker()
    Dim N As Long, i As Long, ary
    
    With Sheets("Sheet1")
        N = .Cells(Rows.Count, "A").End(xlUp).Row
        ReDim ary(1 To N) As String
        For i = 1 To N
            ary(i) = .Cells(i, 1).Value
        Next i
    End With
    
    For i = 1 To N
        ActiveWorkbook.Sheets.Add after:=Worksheets(Worksheets.Count)
        ActiveSheet.Name = "Sheet" & i & "-" & ary(i)
    Next i
End Sub


Thanks a lot.

Can i know the process to run this Macro?
In sheet1, right click, View code, select work sheet and pate it... is it right?
but nithing is happening

Regards,
Anil
 
Upvote 0
its working now but every sheet have name is like this
sheet1-aaaa
sheet2-bbbb

it should only be
aaaa
bbbb

Regards,
Anil
 
Upvote 0
Thx a lot. its working now...

Now can i have the all sheet name in the rescpective A cell. So it will be easy for me to search.

Example:
Sheet 1:
Name: aaaa
In sheet 1 A cell it should be aaaa

Sheet 2:
Name bbbbb
In sheet 2 A cell it should be bbbb
 
Upvote 0

Forum statistics

Threads
1,214,829
Messages
6,121,827
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top