+ Reply to Thread
Results 1 to 9 of 9

Help making Vloop up go to the next cell when using For Each

  1. #1
    Registered User
    Join Date
    09-22-2012
    Location
    Sacramento, California
    MS-Off Ver
    Excel 2010
    Posts
    8

    Help making Vloop up go to the next cell when using For Each

    Hi,

    I am trying to use vba to insert a column then insert a Vlookup which will compare the values in column D to the second sheet and return the text in the 3rd row to column C and repeat

    So, the problem I am running into is that it stops after the first 1 or 2 rows when it has about 4000 more to go..

    Please Login or Register  to view this content.
    Thank you!

    See file here
    Test Excel.xlsm
    Last edited by Keatonyoung; 10-04-2012 at 08:18 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help making Vloop up go to the next cell when using For Each

    Hi

    From the code it is not obvious exactly what is the current sheet when you are running things, but you aren't actioning sheets("Start Here") properly. Try

    Please Login or Register  to view this content.
    Also, can you please edit your post and put code tags around the code snip you have shown. Makes things much easier to read.

    rylo

  3. #3
    Registered User
    Join Date
    09-22-2012
    Location
    Sacramento, California
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Help making Vloop up go to the next cell when using For Each

    Thank you for the reply. It still is only populating the first cell.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help making Vloop up go to the next cell when using For Each

    Hi

    Put up an example file with the macros and some non sensitive data so we can get a better view of what you are doing.

    rylo

  5. #5
    Registered User
    Join Date
    09-22-2012
    Location
    Sacramento, California
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Help making Vloop up go to the next cell when using For Each

    Added example in original thread.

  6. #6
    Registered User
    Join Date
    09-22-2012
    Location
    Sacramento, California
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Help making Vloop up go to the next cell when using For Each

    Test Excel.xlsm

    See attachment above

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help making Vloop up go to the next cell when using For Each

    Hi

    OK, try this

    Please Login or Register  to view this content.
    rylo

  8. #8
    Registered User
    Join Date
    09-22-2012
    Location
    Sacramento, California
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Help making Vloop up go to the next cell when using For Each

    Worked perfect! what was the issue?

  9. #9
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Help making Vloop up go to the next cell when using For Each

    Hi

    A few things.

    1) the .range was missing to make sure it was working within the with block.
    2) Once you inserted the blank column into C, you had to move the range selection block to D not C as there was nothing there (this would have been the biggest issue)
    3) You were trying to put the vlookup formula into the cell below the one that was being actioned.

    rylo

+ 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