Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Insert the same value in other sheets

Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a commandbutton.

Any ideas?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Insert the same value in other sheets

Just use the control or shift key to select the sheets desired. then put 100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a commandbutton.

Any ideas?





  #3   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Insert the same value in other sheets

or programmatically you could use

Sheets(Array("Sheet3", "Sheet2", "Sheet1")).Select
Sheets("Sheet3").Activate
range("a100").value = "100"



"Don Guillett" wrote:

Just use the control or shift key to select the sheets desired. then put 100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a commandbutton.

Any ideas?






  #4   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Insert the same value in other sheets

Thank you for your advice but I want to execute it by code. I only used an
example to describe what I wish to do. I do not want to go into the other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired. then put

100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a

commandbutton.

Any ideas?







  #5   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Insert the same value in other sheets

of course if you don't want to write an enormous array line if you have lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only used an
example to describe what I wish to do. I do not want to go into the other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired. then put

100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a

commandbutton.

Any ideas?










  #6   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Insert the same value in other sheets

Almost there!
The value in Sheet1!A1 will change frequently consequently the code will
need to first recognize the value then replicate it in the other sheets. The
should mention, the other sheets (in the live workbook it will be used in)
will have a different cell range for the value change to.


"ben" wrote in message
...
of course if you don't want to write an enormous array line if you have

lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only used

an
example to describe what I wish to do. I do not want to go into the

other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired. then

put
100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a

commandbutton.

Any ideas?










  #7   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Insert the same value in other sheets

you can enter a sub in the worksheet level object in vba


private sub worksheet_change(Byval Target as Address)
if target.row = 'put target row here and target.column = 'put target column
here (in a number not a letter) then
now insert your change code with the change of target.value instead of
range("a1").value

end if
end sub

"Pat" wrote:

Almost there!
The value in Sheet1!A1 will change frequently consequently the code will
need to first recognize the value then replicate it in the other sheets. The
should mention, the other sheets (in the live workbook it will be used in)
will have a different cell range for the value change to.


"ben" wrote in message
...
of course if you don't want to write an enormous array line if you have

lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only used

an
example to describe what I wish to do. I do not want to go into the

other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired. then

put
100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a
commandbutton.

Any ideas?











  #8   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Insert the same value in other sheets

Correct me if I am wrong, by using
private sub worksheet_change(Byval Target as Address)

will had over control to the sheet and any changes will take place
automatically?

If this is the case I prefer not to go down this route, but instead execute
code as and when desired.


"ben" wrote in message
...
you can enter a sub in the worksheet level object in vba


private sub worksheet_change(Byval Target as Address)
if target.row = 'put target row here and target.column = 'put target

column
here (in a number not a letter) then
now insert your change code with the change of target.value instead of
range("a1").value

end if
end sub

"Pat" wrote:

Almost there!
The value in Sheet1!A1 will change frequently consequently the code will
need to first recognize the value then replicate it in the other sheets.

The
should mention, the other sheets (in the live workbook it will be used

in)
will have a different cell range for the value change to.


"ben" wrote in message
...
of course if you don't want to write an enormous array line if you

have
lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only

used
an
example to describe what I wish to do. I do not want to go into the

other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired.

then
put
100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a
commandbutton.

Any ideas?













  #9   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Insert the same value in other sheets

yes it will do so automatically, however if you wish to do so as desired
you can do many things, you can assign macro to a shortcut key, to a command
button, call it from another macro, you can assign it to a menu button, or
even put it on a userform

"Pat" wrote:

Correct me if I am wrong, by using
private sub worksheet_change(Byval Target as Address)

will had over control to the sheet and any changes will take place
automatically?

If this is the case I prefer not to go down this route, but instead execute
code as and when desired.


"ben" wrote in message
...
you can enter a sub in the worksheet level object in vba


private sub worksheet_change(Byval Target as Address)
if target.row = 'put target row here and target.column = 'put target

column
here (in a number not a letter) then
now insert your change code with the change of target.value instead of
range("a1").value

end if
end sub

"Pat" wrote:

Almost there!
The value in Sheet1!A1 will change frequently consequently the code will
need to first recognize the value then replicate it in the other sheets.

The
should mention, the other sheets (in the live workbook it will be used

in)
will have a different cell range for the value change to.


"ben" wrote in message
...
of course if you don't want to write an enormous array line if you

have
lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only

used
an
example to describe what I wish to do. I do not want to go into the
other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired.

then
put
100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a
commandbutton.

Any ideas?














  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Insert the same value in other sheets

Ben,
VBA doesn't provide much support for grouped sheets. If you run your code,
you will see only the activesheet (sheet3) gets the value of 100.

You can trick Excel with some things however, by selecting the cell.

Sub Tester1()
Sheets(Array("Sheet3", "Sheet2", "Sheet1")).Select
Sheets("Sheet3").Activate
Range("a100").Select
Selection.Value = "100"

End Sub

The above modification will put the value in all 3 sheets.

--
Regards,
Tom Ogilvy


"ben" wrote in message
...
or programmatically you could use

Sheets(Array("Sheet3", "Sheet2", "Sheet1")).Select
Sheets("Sheet3").Activate
range("a100").value = "100"



"Don Guillett" wrote:

Just use the control or shift key to select the sheets desired. then put

100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a

commandbutton.

Any ideas?










  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Insert the same value in other sheets

Are you saying if a change is made anywhere it one sheet it should be
replicated in all sheets.

If not, what are you saying? Is it only if a change is made in a specific
cell; as specific set of cells?

--
Tom Ogilvy

"Pat" wrote in message
...
Almost there!
The value in Sheet1!A1 will change frequently consequently the code will
need to first recognize the value then replicate it in the other sheets.

The
should mention, the other sheets (in the live workbook it will be used in)
will have a different cell range for the value change to.


"ben" wrote in message
...
of course if you don't want to write an enormous array line if you have

lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only

used
an
example to describe what I wish to do. I do not want to go into the

other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired. then

put
100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a
commandbutton.

Any ideas?












  #12   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Insert the same value in other sheets

Sorry for the lack of clarity.
I have in the meantime worked out what I need and here it is:

Private Sub ReplicateV_Click()
With Me.Range("K23")
..Value = .Value
Worksheets("Invref").Range("E23").Value = .Value
Worksheets("CaSS").Range("K18").Value = .Value
Worksheets("CaSE").Range("K18").Value = .Value
End With
End Sub

Thank you gentlemen for your contributions.
Pat


"Tom Ogilvy" wrote in message
...
Are you saying if a change is made anywhere it one sheet it should be
replicated in all sheets.

If not, what are you saying? Is it only if a change is made in a specific
cell; as specific set of cells?

--
Tom Ogilvy

"Pat" wrote in message
...
Almost there!
The value in Sheet1!A1 will change frequently consequently the code will
need to first recognize the value then replicate it in the other sheets.

The
should mention, the other sheets (in the live workbook it will be used

in)
will have a different cell range for the value change to.


"ben" wrote in message
...
of course if you don't want to write an enormous array line if you

have
lots
of sheets you could use

sub samevalue ()
for each w in activeworkbook.sheets
w.range("a100").value = 100 ' or whatever value
next
end usb

"Pat" wrote:

Thank you for your advice but I want to execute it by code. I only

used
an
example to describe what I wish to do. I do not want to go into the

other
sheets to look for the cells in question.

Pat

"Don Guillett" wrote in message
...
Just use the control or shift key to select the sheets desired.

then
put
100
in a1. Excel will put it in all

--
Don Guillett
SalesAid Software

"Pat" wrote in message
...
Hi,
If Sheet1!A1 = 100
then Sheet2!A1 = 100, Sheet3!A1 = 100, Sheet4!A1 = 100

I do not want to use a formula preferring to execute via a
commandbutton.

Any ideas?














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
Insert row on multiple sheets aussiegirlone Excel Discussion (Misc queries) 6 July 17th 09 12:54 PM
Insert row on multiple sheets aussiegirlone Excel Discussion (Misc queries) 0 July 16th 09 04:01 AM
insert a hyperlinked TOC (of sheets) into Excel Geoff W Excel Discussion (Misc queries) 1 November 27th 08 01:41 AM
Insert several Sheets juanpablo Excel Discussion (Misc queries) 4 August 29th 08 03:13 AM
How many sheets can i insert??? e_mlm_m Excel Discussion (Misc queries) 2 December 16th 05 04:27 PM


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