Name a bunch of cells each a unique sequential name

UncleBajubjubs

Board Regular
Joined
Jul 11, 2017
Messages
99
Good morning,
Is there a quick way to name a set of set each with its unique name? I have a column of cells, and I want cell A1 to be named "Import1", cell A2 to be named "Import2", etc. Is there a way to do this automatically, or will I have to manually name each cell?
Thanks
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,762
Office Version
2013
Platform
Windows
Try this:
Code:
Sub Name_Me()
'Modified 8/6/2019 10:27:33 AM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim count As Long
count = InputBox("How Many Rows")
    For i = 1 To count
        Cells(i, 1).Name = "Import" & i
    Next
Application.ScreenUpdating = True
End Sub
 

UncleBajubjubs

Board Regular
Joined
Jul 11, 2017
Messages
99
Try this:
Code:
Sub Name_Me()
'Modified 8/6/2019 10:27:33 AM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim count As Long
count = InputBox("How Many Rows")
    For i = 1 To count
        Cells(i, 1).Name = "Import" & i
    Next
Application.ScreenUpdating = True
End Sub

Thanks, that worked great!

I also have a corresponding table which will need similarly numbered named, like "Link1" "Link2", etc., however this column has cell BK6 as the first cell, so I'm not sure that best way to modify the original code.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,762
Office Version
2013
Platform
Windows
Try this for Link:

Code:
Sub Name_Me_Link()
'Modified  8/6/2019  11:06:41 AM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim count As Long
count = InputBox("How Many Rows")
    For i = 6 To count + 5
        Cells(i, "BK").Name = "Link" & i - 5
    Next
Application.ScreenUpdating = True
End Sub
 

UncleBajubjubs

Board Regular
Joined
Jul 11, 2017
Messages
99
Try this for Link:

Code:
Sub Name_Me_Link()
'Modified  8/6/2019  11:06:41 AM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim count As Long
count = InputBox("How Many Rows")
    For i = 6 To count + 5
        Cells(i, "BK").Name = "Link" & i - 5
    Next
Application.ScreenUpdating = True
End Sub
Worked perfectly, thanks!
 

Watch MrExcel Video

Forum statistics

Threads
1,102,682
Messages
5,488,240
Members
407,632
Latest member
varunwalla

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top