+ Reply to Thread
Results 1 to 4 of 4

Delete Data Button

Hybrid View

  1. #1
    Marcus
    Guest

    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???

  2. #2
    arthurjr07@gmail.com
    Guest

    Re: 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


  3. #3
    Marcus
    Guest

    Re: Delete Data Button

    So do I need to create a command button?

    "arthurjr07@gmail.com" 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
    >
    >


  4. #4
    arthurjr07@gmail.com
    Guest

    Re: Delete Data Button

    Go to TOOLS>MACRO>Visual 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


+ 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