Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Button funtion maybe!!

Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it would
duplicate and insert a selected cell range (with formulas) at a set location
below the selected cell range.?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Button funtion maybe!!

Here is the Click event code for a button named CommandButton1...

Private Sub CommandButton1_Click()
Selection.Copy Range("G3")
End Sub

Just change the "G3" to the top left cell reference where you want the copy
to be placed at.

Rick


"adhide" wrote in message
...
Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it would
duplicate and insert a selected cell range (with formulas) at a set
location
below the selected cell range.?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Button funtion maybe!!

I get a compile error: Invalid outside proceedure error for 'HIDE' ???



"Rick Rothstein (MVP - VB)" wrote:

Here is the Click event code for a button named CommandButton1...

Private Sub CommandButton1_Click()
Selection.Copy Range("G3")
End Sub

Just change the "G3" to the top left cell reference where you want the copy
to be placed at.

Rick


"adhide" wrote in message
...
Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it would
duplicate and insert a selected cell range (with formulas) at a set
location
below the selected cell range.?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Button funtion maybe!!

Where did you put the code at? Where did you get the button from (the Forms
or the Visual Basic toolbar)?

Rick


"adhide" wrote in message
...
I get a compile error: Invalid outside proceedure error for 'HIDE' ???



"Rick Rothstein (MVP - VB)" wrote:

Here is the Click event code for a button named CommandButton1...

Private Sub CommandButton1_Click()
Selection.Copy Range("G3")
End Sub

Just change the "G3" to the top left cell reference where you want the
copy
to be placed at.

Rick


"adhide" wrote in message
...
Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it
would
duplicate and insert a selected cell range (with formulas) at a set
location
below the selected cell range.?





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Button funtion maybe!!

I used the VB toolbar (command button) and then selected the 'view code'
button in the VB tool bar? Then there is where I placed the code?

One other Question, the range I want to copy is A1:AA15 (alot of hidden
cells) and then pase it at A17 and so on?


"Rick Rothstein (MVP - VB)" wrote:

Where did you put the code at? Where did you get the button from (the Forms
or the Visual Basic toolbar)?

Rick


"adhide" wrote in message
...
I get a compile error: Invalid outside proceedure error for 'HIDE' ???



"Rick Rothstein (MVP - VB)" wrote:

Here is the Click event code for a button named CommandButton1...

Private Sub CommandButton1_Click()
Selection.Copy Range("G3")
End Sub

Just change the "G3" to the top left cell reference where you want the
copy
to be placed at.

Rick


"adhide" wrote in message
...
Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it
would
duplicate and insert a selected cell range (with formulas) at a set
location
below the selected cell range.?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Button funtion maybe!!

I took your statement "and insert a selected cell range" from your original
posting to mean a range of cells you selected (highlighted)... obviously,
you are not going to be doing that with the range you just told me about. I
am just about to go to sleep for the night... let me look at this in the
morning when I am fresh and see if I can account for what you have now told
me you want to do (unless someone beats me to it and provides you with an
answer while I am asleep).

Rick



"adhide" wrote in message
...
I used the VB toolbar (command button) and then selected the 'view code'
button in the VB tool bar? Then there is where I placed the code?

One other Question, the range I want to copy is A1:AA15 (alot of hidden
cells) and then pase it at A17 and so on?


"Rick Rothstein (MVP - VB)" wrote:

Where did you put the code at? Where did you get the button from (the
Forms
or the Visual Basic toolbar)?

Rick


"adhide" wrote in message
...
I get a compile error: Invalid outside proceedure error for 'HIDE' ???



"Rick Rothstein (MVP - VB)" wrote:

Here is the Click event code for a button named CommandButton1...

Private Sub CommandButton1_Click()
Selection.Copy Range("G3")
End Sub

Just change the "G3" to the top left cell reference where you want the
copy
to be placed at.

Rick


"adhide" wrote in message
...
Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it
would
duplicate and insert a selected cell range (with formulas) at a set
location
below the selected cell range.?







  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Button funtion maybe!!

Okay, using View Code should have taken you to the right place. Instead of
the code I posted yesterday (which was based on a misunderstanding of what
you were asking), use this code instead... copy/paste it into the window
that comes up when you click View Code:

Private Sub CommandButton1_Click()
Range("A1:AA15").Copy Range("A17")
End Sub

After you turn off Design Mode (on the Visual Basic toolbar), pressing the
button should evoke the above Click event code for the button which, in
turn, should copy A1:AA15 to A17:A31(values and formatting, although none of
the rows or columns in the copy will be hidden).

Rick


"adhide" wrote in message
...
I used the VB toolbar (command button) and then selected the 'view code'
button in the VB tool bar? Then there is where I placed the code?

One other Question, the range I want to copy is A1:AA15 (alot of hidden
cells) and then pase it at A17 and so on?


"Rick Rothstein (MVP - VB)" wrote:

Where did you put the code at? Where did you get the button from (the
Forms
or the Visual Basic toolbar)?

Rick


"adhide" wrote in message
...
I get a compile error: Invalid outside proceedure error for 'HIDE' ???



"Rick Rothstein (MVP - VB)" wrote:

Here is the Click event code for a button named CommandButton1...

Private Sub CommandButton1_Click()
Selection.Copy Range("G3")
End Sub

Just change the "G3" to the top left cell reference where you want the
copy
to be placed at.

Rick


"adhide" wrote in message
...
Im wondering if the following is at all possible in excel?

I want to place a button on the worksheet that on enter (press) it
would
duplicate and insert a selected cell range (with formulas) at a set
location
below the selected cell range.?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If funtion in Excel amoreena Excel Worksheet Functions 2 May 8th 07 11:22 PM
Vlookup (and/or) IF funtion Serge Excel Discussion (Misc queries) 1 February 20th 06 05:38 AM
If Funtion David Excel Worksheet Functions 4 November 29th 05 08:09 PM
If funtion help fetzer New Users to Excel 5 July 3rd 05 07:02 PM
IF funtion viddom Excel Discussion (Misc queries) 2 June 30th 05 02:53 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"