Results 1 to 3 of 3

Thread: Creating Names for Cells Using Code (RESOLVED)

  1. #1

    Thread Starter
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127

    Creating Names for Cells Using Code (RESOLVED)

    I am trying to create a loop that will pass through every cell in a column and define it a name based on the cell's value.
    VB Code:
    1. For X = start To finish
    2.             Sheets(2).Cells(X, 6).Name = Sheets(2).Cells(X, 6).Value
    3.     Next X
    I doesn't seem to like this. Any help? Thanks.
    Last edited by Daniel McCool; Aug 30th, 2003 at 11:15 PM.

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    ThisApplication.Names.Add("NewName", "=Sheet1!$A$6")

  3. #3
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    Code:
    c = "a"
    r = "9"
    sh = "sheet1"
    
    s = "=" & sh & "!$" & c & "$" & r
    
    '
    Application.Names.Add "anna", s
    specifically

Posting Permissions

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



Click Here to Expand Forum to Full Width