+ Reply to Thread
Results 1 to 4 of 4

How to use a Define Name variable in VBA procedure

  1. #1
    Registered User
    Join Date
    12-12-2014
    Location
    Salt Spring Island, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1

    How to use a Define Name variable in VBA procedure

    I have a Define Name variable in one of my worksheets. It's called Cur_Month. I want to use it in my VBA procedure. I tried to use something like

    i = Cur_Month

    but it did not recognize Cur_Month.

    Thanks.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to use a Define Name variable in VBA procedure

    Use:
    Please Login or Register  to view this content.
    If the scope of the named range is limited to a single worksheet, you'll have to qualify the range with the appropriate worksheet - e.g.:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How to use a Define Name variable in VBA procedure

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    02-09-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: How to use a Define Name variable in VBA procedure

    Hi,

    Do you mean you have define a named range in one of your worksheets?

    if yes, you will need to define a Range type variable in the VBA procedure and set it to the named range:

    Please Login or Register  to view this content.
    Thanks,
    Excelfandoo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] how to define a variable?
    By inf3 in forum Excel General
    Replies: 5
    Last Post: 05-09-2014, 05:49 PM
  2. using a variable workbook's name to define another variable
    By lordterrin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-30-2013, 05:57 PM
  3. VBA Define Variable
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2012, 12:55 PM
  4. Using a variable calculated in a procedure in another procedure.
    By Trinidad3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-06-2010, 04:51 AM
  5. How to define variable
    By kishore in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2005, 06:06 AM

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