+ Reply to Thread
Results 1 to 5 of 5

Run same command in a range of rows

  1. #1
    Registered User
    Join Date
    12-31-2015
    Location
    Zaragoza
    MS-Off Ver
    2013
    Posts
    2

    Question Run same command in a range of rows

    Hello.

    I'm a newby to VBS, but need to run the same commands in all the rows from 2 to 500
    This is what I have to do in all the rows (excample from row 2):
    Please Login or Register  to view this content.
    Is it possible to change the cell Reference to use "x" instead of number? I have Googled and tried, but I'm not able to do it.
    Then I could use "x" instead of the number in this code:
    Please Login or Register  to view this content.

    Or how to do this?

    Best regards Andreas
    Last edited by alansidman; 12-31-2015 at 08:56 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Run same command in a range of rows

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Run same command in a range of rows

    Here is an example of how to do a loop
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-31-2015
    Location
    Zaragoza
    MS-Off Ver
    2013
    Posts
    2

    Re: Run same command in a range of rows

    Thanks a lot for Your quick and helpful answer alansidman.

    That solved my problem.

    Andreas

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Run same command in a range of rows

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

+ 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. is there a For(<variable>,<low range>,<high range>) like command?
    By bweslake in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-08-2014, 03:34 AM
  2. [SOLVED] Command Button to Hide rows based on a date range in Column A
    By mhewitson15 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-24-2014, 06:21 PM
  3. Replies: 4
    Last Post: 09-24-2013, 05:44 AM
  4. VBA Command to delete the rows.
    By mohan_rajun in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-25-2010, 10:01 AM
  5. VBA command to go at the end of rows
    By mohan_rajun in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2010, 04:01 AM
  6. NEED HELP with Range command
    By Dan Thompson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2006, 11:50 AM
  7. I need Help With Range Command
    By Dan Thompson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2006, 03:24 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