+ Reply to Thread
Results 1 to 3 of 3

How to refer "user's define reference" in a macro?

  1. #1
    Registered User
    Join Date
    05-16-2009
    Location
    Bangkok
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    How to refer "user's define reference" in a macro?

    Hi,
    I have a few questions regarding inputting user's defined reference in macro. Let me explain with the following code sample (my problems are listed in 1-3 of below sample).

    Please Login or Register  to view this content.

    Please help fixing above 1-3 codes with proper ones.
    Last edited by dusit_t; 04-09-2012 at 11:27 AM.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: How to refer "user's define reference" in a macro?

    I would suggest you find the last row using the following trick (instead of prompting the user). This example would find the last row with data in the A column.

    LastRow = activesheet.cells(rows.count,1).end(xlup).row

    What is it you are trying to do exactly, you may be needing to recode this entirely, code you provide an example sheet?
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    05-16-2009
    Location
    Bangkok
    MS-Off Ver
    Excel 2007/2010
    Posts
    12

    Re: How to refer "user's define reference" in a macro?

    Hi GeneralDisarray,

    Thank you for your suggestion on auto finding "LastRow".

    What I try to do with macro is to reformat a text file report into a worksheet that contains formula in predefined format.
    The real worksheet has more complicate data; therefore, I created another sample worksheet with some descriptions about my requirement. As I'm not very keen on macro, I have not yet added the routine to this sample sheet. Anyway, I think this info. would help you understanding my needs.

    Dusit
    Attached Files Attached Files

+ 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