#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Insert row

Hi,

Based upon some type of selection method (check box, value 1, etc) how
would i get excel to insert 2 rows?? ie: cell A1 on sheet1 1, then insert
2 rows on sheet2 after a30.....any suggestions would be great!!!!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Insert row

Sub test()
If Worksheets("Sheet1").Range("A1").Value 1 Then
Worksheets("Sheet2").Range("31:32").Insert xlShiftDown
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Hi,

Based upon some type of selection method (check box, value 1, etc) how
would i get excel to insert 2 rows?? ie: cell A1 on sheet1 1, then

insert
2 rows on sheet2 after a30.....any suggestions would be great!!!!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Insert row

Thanks Rob! Is this all i need or is there another part of the code??

"Rob van Gelder" wrote in message
...
Sub test()
If Worksheets("Sheet1").Range("A1").Value 1 Then
Worksheets("Sheet2").Range("31:32").Insert xlShiftDown
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Hi,

Based upon some type of selection method (check box, value 1, etc) how
would i get excel to insert 2 rows?? ie: cell A1 on sheet1 1, then

insert
2 rows on sheet2 after a30.....any suggestions would be great!!!!






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Insert row

Your request was an example for:

"cell A1 on sheet1 1, then insert 2 rows on sheet2 after a30"

That's what the code I supplied does.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Thanks Rob! Is this all i need or is there another part of the code??

"Rob van Gelder" wrote in message
...
Sub test()
If Worksheets("Sheet1").Range("A1").Value 1 Then
Worksheets("Sheet2").Range("31:32").Insert xlShiftDown
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Hi,

Based upon some type of selection method (check box, value 1, etc)

how
would i get excel to insert 2 rows?? ie: cell A1 on sheet1 1, then

insert
2 rows on sheet2 after a30.....any suggestions would be great!!!!








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Insert row

i understand but i am a novice to VB. Do i simply need to insert this or
create a click event??
"Rob van Gelder" wrote in message
...
Your request was an example for:
.
"cell A1 on sheet1 1, then insert 2 rows on sheet2 after a30"

That's what the code I supplied does.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Thanks Rob! Is this all i need or is there another part of the code??

"Rob van Gelder" wrote in

message
...
Sub test()
If Worksheets("Sheet1").Range("A1").Value 1 Then
Worksheets("Sheet2").Range("31:32").Insert xlShiftDown
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Hi,

Based upon some type of selection method (check box, value 1, etc)

how
would i get excel to insert 2 rows?? ie: cell A1 on sheet1 1, then
insert
2 rows on sheet2 after a30.....any suggestions would be great!!!!












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Insert row

Code is triggered to run. How that's triggered depends on what you need it
for.

For example, if you wanted that code to run whenever a button is clicked:
From Visual Basic: Insert Module - insert the code into the module
From Excel: Ensure the Form toolbar is visible (View | Toolbars | Forms)
Drop a Button onto your worksheet (an 'assign macro' window appears)
Assign the macro


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
i understand but i am a novice to VB. Do i simply need to insert this or
create a click event??
"Rob van Gelder" wrote in message
...
Your request was an example for:
.
"cell A1 on sheet1 1, then insert 2 rows on sheet2 after a30"

That's what the code I supplied does.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Thanks Rob! Is this all i need or is there another part of the code??

"Rob van Gelder" wrote in

message
...
Sub test()
If Worksheets("Sheet1").Range("A1").Value 1 Then
Worksheets("Sheet2").Range("31:32").Insert xlShiftDown
End If
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gav meredith" wrote in message
...
Hi,

Based upon some type of selection method (check box, value 1,

etc)
how
would i get excel to insert 2 rows?? ie: cell A1 on sheet1 1,

then
insert
2 rows on sheet2 after a30.....any suggestions would be great!!!!














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
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
insert row / insert column command buttons fairgreen Excel Worksheet Functions 1 October 29th 07 02:41 PM
How can I insert a date with an icon (calendar) insert Alfredo Mederico[_2_] Excel Discussion (Misc queries) 4 September 21st 07 01:20 AM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM


All times are GMT +1. The time now is 10:18 PM.

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

About Us

"It's about Microsoft Excel"