+ Reply to Thread
Results 1 to 7 of 7

Variable passing of parameters in a macro

  1. #1
    Registered User
    Join Date
    12-04-2007
    Posts
    6

    Variable passing of parameters in a macro

    I have two worksheets and want to
    1) select a cell in sheet 1 (cell may change with each search),
    2) copy that value,
    3) search for the value in the other sheet (filter)
    4) copy the values returned and
    5) place those values in a specific region in the first spreadsheet

    I can do this manually in a macro, but I don't know how to pass a new cell value each time I run the macro in step 1. The value remains hardcoded to the initial value recorded. Do I have to ask the user to select the cell? But how do I capture in in the macro and use it?

    The macro code:

    Please Login or Register  to view this content.
    Thanks!
    Last edited by gswhoop; 12-04-2007 at 03:48 PM.

  2. #2
    Registered User
    Join Date
    12-04-2007
    Posts
    6

    Angry Help!

    I think I'm forgotten because I'm on the second page. Can someone help me...I would love to get this done today and I think it's a simple problem, but just can't find infor and don't know VB

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Welcome to the forum.

    "1) select a cell in sheet 1", I presume this is Sheet1 E3 in the macro.

    It looks like the code copies that cell, but doesn't paste it anywhere.

    This will prompt the user to click on a cell. Sheet 2 will be filtered on the value in that cell and a column copied to 2008 Edit Cal Deadlines. I hope it does what you want.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-04-2007
    Posts
    6

    I get an error.

    The error says it is unable to set the width property of the window class...how do I fix this?

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I was wondering about that code. It has nothing to do with the problem you described.
    Removing this
    Please Login or Register  to view this content.
    and this
    Please Login or Register  to view this content.
    will get the window pains out of the way until the find and filter is debugged.

  6. #6
    Registered User
    Join Date
    12-04-2007
    Posts
    6

    It works now...

    I want to thank you so much!!!! I did get rid of the window so it pastes it in the middle of the window, but that's OK...This is a great forum and I can't thank you enough!

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    You're welcome.

+ 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