+ Reply to Thread
Results 1 to 8 of 8

searching in a dynamic row range.

  1. #1
    Registered User
    Join Date
    07-08-2011
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    3

    searching in a dynamic row range.

    Hi, I have this piece of code:
    Please Login or Register  to view this content.
    Right now it searching inside the range from row 26 to row 592. ( i am not sure if it is, just based on the code ) Thing is that i want it to search in a dynamic row range that is store in 2 variables that are going to change from time to time. But i am not able to do so.

    I have tried .Row("range1:range2") with range1 and range2 as the two integers
    I also tried .Range("range1:range2") with range1 and range2 as strings of "B"&26 and "B"&592

    I am pretty new to macro VBA, please help. Does macro allows that? or do i have to do something different

    Thank you.
    Last edited by banh; 07-10-2011 at 05:39 PM.

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    re: searching in a dynamic row range.

    Hi banh and welcome to the forum. Please read the forum rules located here and wrap your code with code tags as per rule #3. Once you do that someone will be able to help you.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    07-08-2011
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: searching in a dynamic row range.

    Quote Originally Posted by Mordred View Post
    Hi banh and welcome to the forum. Please read the forum rules located here and wrap your code with code tags as per rule #3. Once you do that someone will be able to help you.
    Thanks for reminding me.

  4. #4
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    re: searching in a dynamic row range.

    Hi banh, would you be able to show your full procedure so that we can see exactly what is going on with regards to
    Please Login or Register  to view this content.
    &
    Please Login or Register  to view this content.
    By what you have submitted,
    Please Login or Register  to view this content.
    should be something like
    Please Login or Register  to view this content.
    but without seeing the rest of your code it is hard to ascertain whether that is the end all fix.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    re: searching in a dynamic row range.

    hi, banh, try this out

    Please Login or Register  to view this content.

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    re: searching in a dynamic row range.

    I suspect as your rows can be variable you want to find the last row dynamically.

    Please Login or Register  to view this content.

    You could also control ColNo and FirstRow if we knew the conditions to work to.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Registered User
    Join Date
    07-08-2011
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: searching in a dynamic row range.

    Quote Originally Posted by watersev View Post
    hi, banh, try this out

    Please Login or Register  to view this content.
    Thank you so much, I think that does it. Just for reference, I was trying to search the variable sText in a certain row range of thousands of items. I already know how to search for the starting row index and the ending row index but don't know the syntax to put it in the equation to find. Now I know, thanks so much, you save my life.

    May I ask is there a site that contains all syntax information for things like this along with explanation like oracle has for Java? I have been looking everywhere online, all they have are just basic ones.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    re: searching in a dynamic row range.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved. Please read all the Rules and don't use phraes like "Need help" in thread titles.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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