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 / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Code on button how?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pieter geerts - 11 Dec 2006 20:24 GMT
I want the following code attach to a commandbutton.

Sub Rij_Invoegen()
 ActiveCell.Offset(1, 0).EntireRow.Insert
End Sub

I wont get it working. I want to insert a row under the row i select.

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Dave Peterson - 11 Dec 2006 21:07 GMT
If you use a commandbutton (a commandbutton is from the control toolbox
toolbar), just double click on it and you'll see where the code goes.  You'll
just copy|paste that single line--it'll already have the name of the sub and the
End sub line.

If you used a button from the Forms toolbar, you could put your code in a
General module--not behind the worksheet, not behind ThisWorkbook and then
rightclick on that button and choose assign macro.

If you're gonna use this same code for buttons on lots of worksheets, I'd use
the forms button.  Each of these forms button can have the same macro assigned
to it.

With commandbuttons, you'll be duplicating the code for each button.

> I want the following code attach to a commandbutton.
>
[quoted text clipped - 6 lines]
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Signature

Dave Peterson


Rate this thread:






 
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.