Results 1 to 7 of 7

Variable passing of parameters in a macro

Threaded View

gswhoop Variable passing of... 12-04-2007, 02:55 PM
gswhoop Help! 12-04-2007, 05:20 PM
mikerickson Welcome to the forum. "1)... 12-04-2007, 09:03 PM
gswhoop I get an error. 12-05-2007, 01:39 AM
mikerickson I was wondering about that... 12-05-2007, 02:05 AM
  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:

    Sub Macro9()
    '
    ' Macro9 Macro
    '
    
    '
        ActiveWindow.Panes(1).Activate
        Range("E3").Select
        Selection.Copy
        With ActiveWindow
            .Width = 933.75
            .Height = 573.75
        End With
        Sheets("Sheet2").Select
        ActiveSheet.Range("$A$1:$GH$1670").AutoFilter Field:=2, Criteria1:= _
            "=DM Review", Operator:=xlAnd
        Columns("B:O").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("2008 Edit Cal Deadlines").Select
        ActiveWindow.Panes(3).Activate
        Range("A222").Select
        ActiveSheet.Paste
    End Sub
    Thanks!
    Last edited by gswhoop; 12-04-2007 at 03:48 PM.

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