Name a bunch of cells each a unique sequential name
Results 1 to 6 of 6

Thread: Name a bunch of cells each a unique sequential name
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jul 2017
    Posts
    81
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Name a bunch of cells each a unique sequential name

    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

  2. #2
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,730
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Name a bunch of cells each a unique sequential name

    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
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please Iím not perfect yet. "Memories are forever"

  3. #3
    Board Regular
    Join Date
    Jul 2017
    Posts
    81
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Name a bunch of cells each a unique sequential name

    Quote Originally Posted by My Aswer Is This View Post
    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.

  4. #4
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,730
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Name a bunch of cells each a unique sequential name

    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
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please Iím not perfect yet. "Memories are forever"

  5. #5
    Board Regular
    Join Date
    Jul 2017
    Posts
    81
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Name a bunch of cells each a unique sequential name

    Quote Originally Posted by My Aswer Is This View Post
    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!

  6. #6
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,730
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Name a bunch of cells each a unique sequential name

    Glad I was able to help you.
    Come back here to Mr. Excel next time you need additional assistance.
    Quote Originally Posted by UncleBajubjubs View Post
    Worked perfectly, thanks!
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please Iím not perfect yet. "Memories are forever"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •