Results 1 to 4 of 4

Command Button - Clear

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2016
    Posts
    270

    Command Button - Clear

    can i delete data (a1:b20) in sheet 1
    and data in (a1:b20) in sheet 2
    thru a command button

    actually i did try to do this as below. but this is giving me a
    "run time error 1004"
    "select method range class failed"

    any help on where i am going wrong

    Private Sub CommandButton1_Click()
    Sheets("sheet1").Activate
       Range("a1:b20").Select
       Selection.ClearContents
       Sheets("sheet2").Activate
       Range("a1:b20").Select
       Selection.ClearContents
    end sub
    Last edited by grkchakri; 03-05-2012 at 12:39 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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