Results 1 to 16 of 16

Thread: Using Dynamic Ranges (without range address) inside a Formula

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    This code will create locally defined range names for each sheet which has a name starting with "DataSheet" (adjust accordingly):
    Sub AssignRangeNames()
        Dim oSh As Worksheet
        For Each oSh In Worksheets
            If Osh.Name Like "DataSheet*" Then
                oSh.Range("A1").CurrentRegion.Name = "'" & oSh.Name & "'!LocalTable"
            End If
        Next
    End Sub
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  2. #2
    VBAX Regular
    Joined
    Jul 2018
    Posts
    23
    Location
    Quote Originally Posted by Jan Karel Pieterse View Post
    This code will create locally defined range names for each sheet which has a name starting with "DataSheet" (adjust accordingly):
    Sub AssignRangeNames()
        Dim oSh As Worksheet
        For Each oSh In Worksheets
            If Osh.Name Like "DataSheet*" Then
                oSh.Range("A1").CurrentRegion.Name = "'" & oSh.Name & "'!LocalTable"
            End If
        Next
    End Sub
    Thanks Jan Karel Pieterse. But as i mentioned in my first post,

    "I need help to Replace cell range ($A$1:$I$1,K$1,$A2:$I2) to 'something' as i wont be knowing cell range except starting cell A1"

    ​(P.S. I can use your code in the later stage once i get solution to my first post. Thank You)

Tags for this Thread

Posting Permissions

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