+ Reply to Thread
Results 1 to 6 of 6

Use the recorder to query a cell and run another macro?

  1. #1
    Registered User
    Join Date
    02-26-2007
    Posts
    22

    Use the recorder to query a cell and run another macro?

    I dont know how to program VB so I just use the macro recorder. I have 15 macros recorded and I need a way to use macro recorder to query a cell and run the corresponding macro assigned to that value (1-15). So if the cell it querys has a 3 in it, it would run macro "three" and then automatically query the next highlighted cell (the cell the previous macro ended on) and so on. Not sure if it can be done, but if it can, itll save me hours.

    Thanx guys.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sounds like a job for select case

    http://www.ozgrid.com/VBA/select-case.htm

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    02-26-2007
    Posts
    22
    Ya, like I said, I dont know how to do any VB coding. I need something I can either use the recorder in, or a drag and drop VB code that I can just paste into VB.

    Thanx for the help.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Does this example help

    Any question post back.

    VBA Noob
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-26-2007
    Posts
    22
    Ya, I couldnt figure out how to use that tutorial. I tried just adapting that code to my spreadsheet, but I couldnt get it to work. Can you add some comments into that code so I know what I should change to get it to work?
    Also, my macros are all saved in my personal workbook, and it didnt seem like I could reference them in the VB code like you did (macro1). I tried Personal.xls!One but that didnt work (it didnt like the "!")

    Thanx so much for your help.

  6. #6
    Registered User
    Join Date
    02-26-2007
    Posts
    22

    macro to run other macros

    Can someone please help me out? I need some VBA coding that will do the following:

    Query the starting cell's value (1-30) and run a corresponding macro (1-30) and then repeat for the cell the previous macro ended on. Each macro resets the active cell to the beggining cell of the next data set.

    Ive got over a million data entries I need to do this to, so a macro would really help. I dont know anything about macro coding (the 30 macros were recorded) so some comments in the coding about what I would need to change to get it to run on my data and with my macros would be great.

    Thank you so much in advance for your help. This forum is awesome.


    -Jason

+ 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