+ Reply to Thread
Results 1 to 2 of 2

How to form a range name from strings

  1. #1
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    127

    How to form a range name from strings

    I have a number of ranges on a worksheet whose names differ by two digits (i.e., a two digit year). Examples are '_17_data', '_18_data', '_19_data', representing different ranges for data corresponding for years 2017, 2018 and 2019.

    Is there a way to construct the range name in VBA from a variable (yr); i.e., something like rng = "_" & yr & "_data"?

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    127

    Re: How to form a range name from strings

    Never mind. Got it. Set rng = range("_" & yr & "_data")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1