×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Deleting multiple ranges at once

Deleting multiple ranges at once

Deleting multiple ranges at once

(OP)
I would like to delete multiple ranges from multiple spreadsheets at once.

Example:
A workgroup has three Spreadsheets

Sheet 1:
delete the range from c4 to c53 and f4 to f53.
Sheet 2:
Delete the range from c62 to d84
Sheet 3:
Delete the range from a11 to d3 and f2 to k70

I would like to delete all of this ranges by click a button in the spreadsheet.  Please advise how I may accomplish this.

Thank you very much!

RE: Deleting multiple ranges at once

For simple VBA like this just record a macro, then open the macro for editing so you can see how it works

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: Deleting multiple ranges at once

Add a button control where desired within the workbook containing the cells to be cleared.  Be sure to use the control toolbox to add the button.  Add the following code to the worksheet code pane containing the button.


Private Sub CommandButton1_Click()
Sheet1.Range("C4:C53,F4:F53").ClearContents
Sheet2.Range("C62:D84").ClearContents
Sheet3.Range("A11:D3,F2:K70").ClearContents
End Sub

RE: Deleting multiple ranges at once

(OP)
Thank you very much cummings54 for taking the time a create the code for this task.  I really appreciate it very much.  It is working just fine.  Thank you!

Thank you johnwm for your comments.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources