+ Reply to Thread
Results 1 to 7 of 7

need to create a macro program for find:(

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    Metro Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    3

    Unhappy need to create a macro program for find:(

    hi guys,

    good day.

    i have been doing this program for two days now, and i know i'm doing bad.

    i have a little knowledge about VBA, all i do is get the codes from searching from google.

    well, this is what i want to do:

    search and compare all items under column Letter (column B) and get all corresponding number under column Number (Column A) be reflected to column Number1~2(Column D~E).

    i tried doing a nested if statement inside a for-next, but i can't do it right, then i tried the find function of excel, but it seems to be more complicated.

    i hope someone could help me on this.

    this is a sample format, under Number1 and Number2 columns are the supposedly outputs.

    number letter Number1 Number2
    1 a 1 7
    2 b 2
    3 c 3 6
    4 d 4 5
    5 d 5 4
    6 c 6
    7 b 7 2
    find.xls

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: need to create a macro program for find:(

    Please Login or Register  to view this content.
    I think

  3. #3
    Registered User
    Join Date
    10-04-2013
    Location
    Metro Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    3

    Thumbs up Re: need to create a macro program for find:(

    hi yudlugar,

    thank you so much for your reply, your code worked fine.

    but for cases like:
    • the last row for column Number (Column A) and column Letter (Column B) are not defined, and may reach thousands of rows.
    • column Letter (Column B) is 5~7 characters long.

    what would be the revision?

    i saw that you declared count1 and count2, but as what type? is it string?

    please see attachment for another example

    find2.xls

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: need to create a macro program for find:(

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: need to create a macro program for find:(

    Please Login or Register  to view this content.
    variables are declared as variants. You could declare them as integers if you prefer.

  6. #6
    Registered User
    Join Date
    10-04-2013
    Location
    Metro Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: need to create a macro program for find:(

    Hi John,

    thank you for your response. your code works. thank you so much

    Hi yudlugar,

    the revised code works as well...i tried running with 8000 rows, i waited for around 15minutes, but it's worth the wait. i got what i wanted...haha

    thank you so much...salamat salamat

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: need to create a macro program for find:(

    You're welcome. Glad to help out, and thanks for the feedback.

+ 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. Write a VB Macro to create a text data file for a dos program
    By rorw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-27-2012, 10:18 AM
  2. Macro to create PDF from non-Adobe Program
    By SMB in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2010, 11:52 AM
  3. How to create a Macro or function to execute a program
    By akadoggs in forum Excel General
    Replies: 1
    Last Post: 02-26-2008, 04:32 PM
  4. how do i make macro program on excell for create new txt file?
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2006, 01:15 PM
  5. creating macro VB in Excel - find and move program
    By DictatorDraco in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-01-2006, 03:50 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