+ Reply to Thread
Results 1 to 5 of 5

I'm confused this loop works?

  1. #1
    Registered User
    Join Date
    10-12-2019
    Location
    Bangkok, Thailand
    MS-Off Ver
    2007
    Posts
    1

    I'm confused this loop works?

    Please Login or Register  to view this content.

    I'm a bit confused on how this loop actually works......
    L1. I know that it declares aCell as a range variable and QuickText as a string variable.
    L2. Not sure if the for-loop works like the python....Evoke something from Sheet1.Range("F2:G2").Cells into variable aCell...... I'm lost for Sheet1.Range("F2:G2").Cells ( What it actually contains "Value" or "Position") .
    L3. Concatenation between two variables....

    My question is what is heet1.Range("F2:G2").Cells?
    Last edited by TestKing1994; 10-12-2019 at 08:52 AM. Reason: Code Formatting

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    6,630

    Re: I'm confused this loop works?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. 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, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Please Avoid Joining My List Of Blocked Users by:

    Saying Please and Thank you.

    Making requests not demands.

    Checking back on your post. I will not edit any post after 4 days.

    Marking threads as closed once your issue is resolved. How? The tools at the top

    Any reputation (*) points appreciated. None of us gets paid here.

    If you found someone's input useful, please take a second to click the * at the bottom left to let them know

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

    Arrow


    As looping is useless here, just use the & operator to concatenate two values or two variables, whatever

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    6,630

    Re: I'm confused this loop works?

    You started your loop by saying:

    Please Login or Register  to view this content.
    This seems to do the same

    Please Login or Register  to view this content.

    So your macro will perform the same tasks for all the cells in your range

    Horizontally then Vertically in your case You had two cells F2 and G2

    You ended your loop using

    Please Login or Register  to view this content.

    Run this code as a test

    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    10,515

    Re: I'm confused this loop works?

    Ensure the "Immediate window" is open in your VBE.
    run this mod:
    Please Login or Register  to view this content.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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