![]() |
Delete Data Button
I am trying to create a button that when you click it it will delete all data
in a workbook. Anyone have any ideas??? |
Delete Data Button
Private Sub CommandButton1_Click()
Dim ws As Worksheet Dim r As Range For Each ws In Worksheets ws.Activate For Each r In ws.UsedRange MsgBox r Next r Next End Sub |
Delete Data Button
So do I need to create a command button?
" wrote: Private Sub CommandButton1_Click() Dim ws As Worksheet Dim r As Range For Each ws In Worksheets ws.Activate For Each r In ws.UsedRange MsgBox r Next r Next End Sub |
Delete Data Button
Go to TOOLSMACROVisual Basic Editor
then Right Click on VBAProjects on the project window then Insert UserForm On the user form, insert a commandbutton copy and paste the code and then run I hope u understand what i am trying to say:) |
All times are GMT +1. The time now is 02:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com