+ Reply to Thread
Results 1 to 2 of 2

How do I get a macro to work across multiple worksheets?

  1. #1
    Registered User
    Join Date
    01-06-2005
    Location
    PA
    Posts
    7

    How do I get a macro to work across multiple worksheets?

    I use the following macro to update the inventory amount to a specified cell that is connected to a master sheet that shows me the amount in inventory for each item. Right now I have to go to each sheet and run this macro individually which is time consuming.

    Anyone know how I can get it work on all the sheets at once? Each sheet has a name based on what it is inventory.

    thank you

    Range("C1").Select
    Selection.End(xlDown).Select
    Selection.Copy
    Range("E1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub

  2. #2
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451

    How do I get a macro to work across multiple worksheets?

    this should work

    try this macro

    Sub macro()
    For Each w In Worksheets
    w.Select
    Range("C1").Select
    Selection.End(xlDown).Select
    Selection.Copy
    Range("E1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Next
    End Sub

+ 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