Consulting

Results 1 to 8 of 8

Thread: Help me please! Basic Excel macro!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Apr 2020
    Posts
    2
    Location

    Help me please! Basic Excel macro!

    I have this very simple macro to copy and past, values only, into certain cells within a worksheet.

    I need the action to report on all but the first 9 sheets in the workbook (300 in total).

    The macro below seems to be running but it is only actually performing the action on the first sheet in the sequence, sheet 10, all the rest remain unaltered.

    Am I missing something very simple?

    Sub DeleteActionData()
    Dim ws As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    Select Case sh.Name
    Case Is = "Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6", "Sheet7", "Sheet8", "Sheet9"
    Case Else
    Range("C121:M130").Select
        Selection.Copy
        Range("C121").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    End Select
    Next sh
    End Sub
    Last edited by Paul_Hossler; 04-06-2020 at 05:13 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •