Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Command button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard - 12 Mar 2008 01:00 GMT
I have a command button that when clicked I want it to delete the contents
from Sheet1 D1, Sheet1 B3:B100 and Sheet1 D3:D100. Thanks in advance!!!
Dave Peterson - 12 Mar 2008 01:34 GMT
worksheets("Sheet1").range("d1,b3:b100,d3:d100").clearcontents

would be the line that did the real work.

> I have a command button that when clicked I want it to delete the contents
> from Sheet1 D1, Sheet1 B3:B100 and Sheet1 D3:D100. Thanks in advance!!!

Signature

Dave Peterson

Richard - 12 Mar 2008 03:22 GMT
Thanks that works perfect!! Can you also copy Sheet2 Columns, A,B,C to sheet
3 once clicked. Thanks in advance!!

> worksheets("Sheet1").range("d1,b3:b100,d3:d100").clearcontents
>
> would be the line that did the real work.
>
> > I have a command button that when clicked I want it to delete the contents
> > from Sheet1 D1, Sheet1 B3:B100 and Sheet1 D3:D100. Thanks in advance!!!
Dave Peterson - 12 Mar 2008 03:48 GMT
You want to copy 3 whole columns and put them where?  This copies those 3
columns and plops them over A:C of sheet3.

  worksheets("sheet2").range("a:c").copy _
     destination:=worksheets("sheet3").range("A1")

If you wanted the values--not formulas:

  worksheets("sheet2").range("a:c").copy
  worksheets("sheet3").range("A1").pastespecial paste:=xlpastevalues

     

> Thanks that works perfect!! Can you also copy Sheet2 Columns, A,B,C to sheet
> 3 once clicked. Thanks in advance!!
[quoted text clipped - 9 lines]
> >
> > Dave Peterson

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.