+ Reply to Thread
Results 1 to 11 of 11

Make static rows dynamic

  1. #1
    Registered User
    Join Date
    01-15-2023
    Location
    Germany
    MS-Off Ver
    2021
    Posts
    37

    Make static rows dynamic

    Hello,

    I use following code to check a static Range row by row:
    Please Login or Register  to view this content.
    Unfortunately the sheet is too dynamic to work with a static range.
    Is there a way to make the range dynamic? Maybe using a defined name?

    Any help is appreciated.

    Kind regards,
    silverchair

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,091

    Re: Make static rows dynamic

    Untested, but try changing:

    Please Login or Register  to view this content.
    To:
    Please Login or Register  to view this content.
    This assumes that column A is "fully populated".
    Last edited by TMS; 01-29-2023 at 06:06 AM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-15-2023
    Location
    Germany
    MS-Off Ver
    2021
    Posts
    37

    Re: Make static rows dynamic

    Thanks, but the range should be fully dynamic because not just the column is dynamic but also the starting and end row. Also there are used rows below the used range...

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,091

    Re: Make static rows dynamic

    You know that. But you have the advantage of having access to the workbook. No one else knows what you know.



    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Make static rows dynamic


    Hello,

    as nothing is 'dynamic' under Excel in particular when launching any VBA procedure
    so according to your 'static' workbook try to work with the Worksheet.UsedRange property, a VBA help must see …
    Other to see : CurrentRegion, Areas, …

  6. #6
    Registered User
    Join Date
    01-15-2023
    Location
    Germany
    MS-Off Ver
    2021
    Posts
    37

    Re: Make static rows dynamic

    You are both right. You dont see my file, sorry for that. I have tried to put it in an example.
    Attached Files Attached Files

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,091

    Re: Make static rows dynamic

    Try:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-15-2023
    Location
    Germany
    MS-Off Ver
    2021
    Posts
    37

    Re: Make static rows dynamic

    Perfect! Works like a charm. Thank you so much and have a nice sunday.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,091

    Re: Make static rows dynamic

    You're welcome.



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

    Also, 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 those who helped.

  10. #10
    Registered User
    Join Date
    01-15-2023
    Location
    Germany
    MS-Off Ver
    2021
    Posts
    37

    Re: Make static rows dynamic

    I wasnt aware of this. Thank you again. Did as explained)

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,091

    Re: Make static rows dynamic

    You're welcome. Thanks for the rep.

+ 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. Replies: 1
    Last Post: 02-25-2019, 05:28 PM
  2. [SOLVED] adjusting vba code to make it dynamic as rows data rows differ
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-26-2018, 10:37 PM
  3. [SOLVED] To make selected columns (or rows) static
    By billj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2015, 11:50 AM
  4. [SOLVED] Make all values of rows static if condition met
    By alice2011 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-03-2015, 11:38 AM
  5. [SOLVED] Unhide rows based on semi static, semi dynamic value
    By Christopher135 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2013, 01:28 PM
  6. [SOLVED] Make Static code Dynamic
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-05-2012, 11:09 AM
  7. Replies: 3
    Last Post: 06-10-2010, 04:31 PM

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