Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SIMULTANEOUSLY adding rows in two sheets

I use Excel 2003. I want adding rows in one sheet the some number of rows to
be added in other sheet but automatically. I mean, if I add two rows between
33 and 34 row in sheet 1 the some number of rows to be add in sheet 2 between
33 and 34 row.

Thank you in advance for your help.

Radoslav
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default SIMULTANEOUSLY adding rows in two sheets

Hi
select both sheets before doing this (hold down the CTRL key while
selecting the sheets)

--
Regards
Frank Kabel
Frankfurt, Germany

"Radoslav Radev" schrieb im Newsbeitrag
...
I use Excel 2003. I want adding rows in one sheet the some number of

rows to
be added in other sheet but automatically. I mean, if I add two rows

between
33 and 34 row in sheet 1 the some number of rows to be add in sheet 2

between
33 and 34 row.

Thank you in advance for your help.

Radoslav


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default SIMULTANEOUSLY adding rows in two sheets

Radoslaw,

try this:

Sub InsertRows()
Dim myWS As Variant
Application.ScreenUpdating = False
myWS = Array("Sheet1", "Sheet2", "Sheet3")
Sheets(myWS).Select
Rows(5).Insert Shift:=xlDown
Sheets("Sheet1").Select
Application.ScreenUpdating = True
End Sub

Regards,
KL

"Radoslav Radev" wrote in message
...
I use Excel 2003. I want adding rows in one sheet the some number of rows
to
be added in other sheet but automatically. I mean, if I add two rows
between
33 and 34 row in sheet 1 the some number of rows to be add in sheet 2
between
33 and 34 row.

Thank you in advance for your help.

Radoslav



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SIMULTANEOUSLY adding rows in two sheets

Dear KL,

Many thanks for your assistance. Unfortunately the code you have sent me is
not exactly what I was looking for.

Its what you have sent me.

Sub InsertRows()
Dim myWS As Variant
Application.ScreenUpdating = False
myWS = Array("Sheet1", "Sheet2", "Sheet3")
Sheets(myWS).Select
Rows(5).Insert Shift:=xlDown
Sheets("Sheet1").Select
Application.ScreenUpdating = True
End Sub

Most probably I wasnt clear in my problem explanation. Let me try again.

Imagine we are working in sheet1 and you insert two rows somewhere into the
sheet just using the tool bar €“ Insert/rows. I need automatically the same
number of rows with the same address to be inserted into sheet2.

Radoslav


"KL" wrote:

Radoslaw,

try this:

Sub InsertRows()
Dim myWS As Variant
Application.ScreenUpdating = False
myWS = Array("Sheet1", "Sheet2", "Sheet3")
Sheets(myWS).Select
Rows(5).Insert Shift:=xlDown
Sheets("Sheet1").Select
Application.ScreenUpdating = True
End Sub

Regards,
KL

"Radoslav Radev" wrote in message
...
I use Excel 2003. I want adding rows in one sheet the some number of rows
to
be added in other sheet but automatically. I mean, if I add two rows
between
33 and 34 row in sheet 1 the some number of rows to be add in sheet 2
between
33 and 34 row.

Thank you in advance for your help.

Radoslav




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default SIMULTANEOUSLY adding rows in two sheets

Radoslav,

In that case, I don't think your task can be automated, so I would recommend
you use Frank's advise to manually select the sheets (holding Ctrl key) and
then inserting the rows.

The code I sent to you is designed for situations where you need to control
user's input and normally goes together with Sheet protection and RowsInsert
and/or RowsDelete buttons with macros assigned. Thus I totally control the
row input. The only way for the user to insert rows is to use my RowInsert
button, which would trigger my code and the code will take care of 1)
unprotecting the relevant sheets, 2) selecting them, 3) inserting the number
of rows specified by the user in the area where I allow to do so, 4)
reparing formulae where necessary and 5) protecting the sheets again.

Regards,
KL

"Radoslav Radev" wrote in message
...
Dear KL,

Many thanks for your assistance. Unfortunately the code you have sent me
is
not exactly what I was looking for.

It's what you have sent me.

Sub InsertRows()
Dim myWS As Variant
Application.ScreenUpdating = False
myWS = Array("Sheet1", "Sheet2", "Sheet3")
Sheets(myWS).Select
Rows(5).Insert Shift:=xlDown
Sheets("Sheet1").Select
Application.ScreenUpdating = True
End Sub

Most probably I wasn't clear in my problem explanation. Let me try again.

Imagine we are working in sheet1 and you insert two rows somewhere into
the
sheet just using the tool bar - Insert/rows. I need automatically the same
number of rows with the same address to be inserted into sheet2.

Radoslav


"KL" wrote:

Radoslaw,

try this:

Sub InsertRows()
Dim myWS As Variant
Application.ScreenUpdating = False
myWS = Array("Sheet1", "Sheet2", "Sheet3")
Sheets(myWS).Select
Rows(5).Insert Shift:=xlDown
Sheets("Sheet1").Select
Application.ScreenUpdating = True
End Sub

Regards,
KL

"Radoslav Radev" wrote in message
...
I use Excel 2003. I want adding rows in one sheet the some number of
rows
to
be added in other sheet but automatically. I mean, if I add two rows
between
33 and 34 row in sheet 1 the some number of rows to be add in sheet 2
between
33 and 34 row.

Thank you in advance for your help.

Radoslav






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
Adding 3 columns of criteria simultaneously Michael Joseph Cosgriff Excel Worksheet Functions 3 January 2nd 09 03:00 AM
Linked sheets, blank cells and adding new rows CharlieJane Excel Worksheet Functions 1 July 25th 08 07:12 PM
Adding rows to tables in 2 different sheets birdpants Excel Discussion (Misc queries) 1 August 7th 07 11:40 AM
adding data simultaneously onto 3 worksheets Joy Excel Worksheet Functions 1 May 13th 07 07:26 PM
Search two sheets simultaneously cornishbloke[_3_] Excel Programming 1 December 12th 03 08:14 PM


All times are GMT +1. The time now is 07:53 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"