+ Reply to Thread
Results 1 to 6 of 6

Extending ranges with Variable Integers

  1. #1
    Registered User
    Join Date
    03-13-2021
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    12

    Extending ranges with Variable Integers

    I have this code here, where lr is Last Row

    Please Login or Register  to view this content.


    I want it to look like this but excel wont allow it

    Please Login or Register  to view this content.


    Any idea on how to extend ranges with variable integers?
    Last edited by rad042; 10-30-2021 at 03:44 AM.

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,481

    Re: Extending ranges with Variable Integers

    Assuming 'a' is supposed to be a variable, try this...

    ThisWorkbook.Worksheets("Kitchen").Rows(a & ":" & lr).Hidden = False

  3. #3
    Registered User
    Join Date
    03-13-2021
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    12

    Re: Extending ranges with Variable Integers

    Quote Originally Posted by Rick Rothstein View Post
    Assuming 'a' is supposed to be a variable, try this...

    ThisWorkbook.Worksheets("Kitchen").Rows(a & ":" & lr).Hidden = False
    I tried that, and this shows up "Compile error: Expected: list seperator or )"

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,481

    Re: Extending ranges with Variable Integers

    Quote Originally Posted by rad042 View Post
    I tried that, and this shows up "Compile error: Expected: list seperator or )"
    Not sure what to tell you... I tested it and it works fine on my computer (US locale setting if that matters)...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-13-2021
    Location
    Melbourne
    MS-Off Ver
    Microsoft 365
    Posts
    12

    Re: Extending ranges with Variable Integers

    Yes that works! I think maybe because I used
    Please Login or Register  to view this content.
    that might have affected it. Thanks so much.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,917

    Re: Extending ranges with Variable Integers

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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] Name ranges problem when extending scope
    By Marvo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-30-2020, 04:42 AM
  2. Automatically extending data ranges
    By HKPHOOY in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-18-2018, 01:19 PM
  3. wrong calculation when extending variable ranges
    By fxhst329 in forum Excel General
    Replies: 7
    Last Post: 01-30-2011, 05:37 PM
  4. integers and variable values
    By tblaauw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2008, 07:58 AM
  5. Lock Cell Variable so it will only accept integers
    By gplush in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2007, 09:12 AM
  6. Counting variable ranges and auto-summing variable ranges
    By Father Guido in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2006, 11:10 PM
  7. A list of Consecutive Integers, can I search for missing integers
    By CM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM

Tags for this Thread

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