Share via

Clearing Data from Multiple Worksheets

Anonymous
2017-07-11T15:38:33+00:00

I am looking for a macro that would clear out data from a specific set of cells, but on multiple worksheets all at once (or if not a macro, any way to do this?).

Thank you!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2017-07-14T16:40:10+00:00

    I have. Between the weird way these worksheets are set up and my lack of experience with macros, I couldn't get it to work. I just did all 300+ worksheets manually.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-07-14T16:20:24+00:00

    Hi VGS79,

    Have you tried any steps above?

    Thanks,

    Rena

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-07-11T17:15:04+00:00

    If you have merged cells that need to be cleared - using the same ranges and sheets:

    Sub ClearRanges2()

        Dim C As Range

        Dim sh As Worksheet

        For Each sh In Sheets(Array("Sheet1", "Sheet2", "Sheet3"))

            For Each C In sh.Range("D22,A1:B3,C5:D8,E10:E11")

                C.MergeArea.ClearContents

            Next C

        Next sh

    End Sub

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-07-11T16:47:00+00:00

    Thank you! I didn't realize. however, that some of my cells are merged cells, so this won't work.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2017-07-11T16:11:50+00:00

    Group the sheets, using Ctrl-clicks on the tabs (or Shift-Click) then select your cells (area by area or using Ctrl-Drag-click/drag click/drag....) and press Del.  If you record a macro when you do that, it will be easily repeatable. OR you can use this macro, editing it to meet your specific needs:

    Sub ClearRanges()

        Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Range("D22,A1:B3,C5:D8,E10:E11").ClearContents

    End Sub

    Was this answer helpful?

    0 comments No comments