+ Reply to Thread
Results 1 to 3 of 3

Move target on the next row, same column

  1. #1
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Move target on the next row, same column

    It looked easy but I can't make it work so I think I'm doing wrong somewhere.

    I have setup a userform on which I have a combobox that everytime it changes
    I write its text value to the cell I was in, when I fired up the form (target).
    The form is shown when I double click in a certain sheet and before I show it, I have these settings
    to be able to share the variables across different modules:
    Please Login or Register  to view this content.
    In a module I have these declarations:
    Please Login or Register  to view this content.
    Now I'm trying to add a "Next line" button and I would like that when I click on it
    the selection should move to the cell right below the original target.

    I would also need to update the "trg" and the "trgQty" variables so that the other subs
    that use them will be able to point to the newly selected cell.

    To do that I put this code in the click event of the "Next line" button:
    Please Login or Register  to view this content.
    but it does not work.

    I did that because in the click event of an "OK" button I have on the form
    I put this code
    Please Login or Register  to view this content.
    and, if the next line is empty, the selection moves there correctly.

    Hope somebody can help.

    Thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Move target on the next row, same column

    Try using Offset, oh and with objects, eg ranges, you need to use Set.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-03-2005
    Posts
    13

    Re: Move target on the next row, same column

    Thanks, it was just the missing "Set".

    I wish I had a clear view of what is an "object" and what a "method" and what a "property".

    Never been able to grasp it, really.

    fabio

+ 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] VBA data move to target files which names is mention col I:I in master file
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-29-2016, 03:11 PM
  2. Move Target Address Worksheet to the beginning.
    By mmctague in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2013, 06:19 PM
  3. Replies: 0
    Last Post: 10-15-2012, 10:38 AM
  4. [SOLVED] Need alternate syntax 'Select Case' on Target.Column and Target.Row at the same time.
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2012, 11:19 AM
  5. Replies: 3
    Last Post: 02-14-2012, 10:37 AM
  6. If target.column = 5 then move to next column...
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-14-2012, 08:30 PM
  7. Bar chart with 'target' lines but target varies per column
    By Ineedcoffee in forum Excel Charting & Pivots
    Replies: 14
    Last Post: 11-24-2011, 05:41 AM

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