+ Reply to Thread
Results 1 to 11 of 11

Trying to get info from next column not next row - VBA

  1. #1
    Registered User
    Join Date
    05-27-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office 365
    Posts
    18

    Trying to get info from next column not next row - VBA

    Dear all,

    below is my code, which works great except for one purpose. The info that comes from worksheet two, needs to be one from column to the right. The only thing I can manage to change is the row but not the column. I expect I need to make a difference in the following line but I can't see how:

    Please Login or Register  to view this content.



    Please Login or Register  to view this content.

    Thanks!
    Gini

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Trying to get info from next column not next row - VBA

    https://www.excelforum.com/excel-pro...ml#post5524557

    What do you want to do this time?

  3. #3
    Registered User
    Join Date
    05-27-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office 365
    Posts
    18

    Re: Trying to get info from next column not next row - VBA

    I am trying to use your amazing code to go one column to the right with the Y variable. I have figured out how to adapt for most of my information but not how to move the column for Worksheet Verpackungen.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Trying to get info from next column not next row - VBA

    Are you talking about this line?
    Please Login or Register  to view this content.
    y is the variable only holding the row references where Col.B of Verpackungen has "Article Number".
    So if you say, "one col to the right" would mean col ref to output? or referencing column of source data?

  5. #5
    Registered User
    Join Date
    05-27-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office 365
    Posts
    18

    Re: Trying to get info from next column not next row - VBA

    The line you mention currently when I change = ws2.Cells(y(i) + 1, "i") to for example = ws2.Cells(y(i) + 2, "i") it'll get the data from one row below. Instead I would like to get the data from the same row but one column to the right

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Trying to get info from next column not next row - VBA

    If you want from the same row, just delete + 1, however you have merged cell in I:J, so changing col ref to "j" doesn't make sense unless you have different data layouts.

  7. #7
    Registered User
    Join Date
    05-27-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office 365
    Posts
    18

    Re: Trying to get info from next column not next row - VBA

    Hi Jindon,

    what if I don't want to change the row for that part of the VBA but the column? The information I'm trying to grab is one column to the right

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Trying to get info from next column not next row - VBA

    "i" is the column reference for col.I.

    So try change it to something else like "j", "k", "c","d" etc. and see what happens for yourself.

  9. #9
    Registered User
    Join Date
    05-27-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office 365
    Posts
    18

    Re: Trying to get info from next column not next row - VBA

    Thank you yes! That's perfect!

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Trying to get info from next column not next row - VBA

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

  11. #11
    Registered User
    Join Date
    05-27-2021
    Location
    Germany
    MS-Off Ver
    Microsoft Office 365
    Posts
    18

    Re: Trying to get info from next column not next row - VBA

    Done thanks once again! Trying to figure out another thing but will try again myself first of course!

+ 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. [SOLVED] Calculating info in a column based on a "greater than" date & info in another column
    By fpm2002 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-06-2017, 12:58 AM
  2. Need to duplicate a column's info while adding new info and subtracting old
    By kundalinikid in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-09-2015, 06:10 PM
  3. Replies: 4
    Last Post: 10-02-2013, 03:00 PM
  4. If column is populated, copy and paste info. into new workbook(keeping other column info.)
    By mary.gallagher in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2013, 02:56 PM
  5. Converting column info to row info
    By NYH471 in forum Excel General
    Replies: 4
    Last Post: 09-11-2011, 08:42 PM
  6. edit macro that is pasting info to check column for duplicate info
    By roth_nj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2009, 05:55 PM
  7. Replies: 1
    Last Post: 02-21-2006, 10:30 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