PC Review


Reply
Thread Tools Rate Thread

Code on button how?

 
 
Pieter geerts
Guest
Posts: n/a
 
      11th Dec 2006
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.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      11th Dec 2006
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.

Pieter geerts wrote:
>
> 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.
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Button calling aother button's code Patrice Microsoft VB .NET 0 15th Apr 2010 05:07 PM
Re: Button calling aother button's code Armin Zingler Microsoft VB .NET 0 15th Apr 2010 04:39 PM
Re: Button calling aother button's code Mr. Arnold Microsoft VB .NET 0 15th Apr 2010 04:20 PM
Re: Button calling aother button's code Family Tree Mike Microsoft VB .NET 0 15th Apr 2010 04:19 PM
How to assign same code inside Option button code space ?? furbiuzzu Microsoft Excel Programming 1 21st Nov 2006 02:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:15 PM.