Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Still trying to copy info from one sheet to another

I have two identical sheets. If something is entered into a cell in sheet1, how do I get excel to automatically enter the same value into an identical cell in sheet2 and do this on a cell by cell basis not as a copy of a range of cells? Any help is greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Still trying to copy info from one sheet to another

Hi Erik
maybe i'm missing something but enter
='sheet1'!A1
in cell A1 on sheet 2 and copy down. or you may use
=IF('sheet1'!A1<"",'sheet1'!A1,"")


--
Regards
Frank Kabel
Frankfurt, Germany

Erik wrote:
I have two identical sheets. If something is entered into a cell in
sheet1, how do I get excel to automatically enter the same value into
an identical cell in sheet2 and do this on a cell by cell basis not
as a copy of a range of cells? Any help is greatly appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Still trying to copy info from one sheet to another

Erik,

Put this code in the Sheet1 worksheet code module

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Worksheets("Sheet2").Range(Target.Address).Value = _
Target.Value
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Erik" wrote in message
...
I have two identical sheets. If something is entered into a cell in

sheet1, how do I get excel to automatically enter the same value into an
identical cell in sheet2 and do this on a cell by cell basis not as a copy
of a range of cells? Any help is greatly appreciated.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Still trying to copy info from one sheet to another

Frank,
Problem is I have code in both sheets to format the cells color based on the text value in the cell. Using the formula in sheet2, the code doesn't seem to recognize the value and therefore doesn't format the cell. I was thinking there must be a way to modify my existing cell formatting code to do the job or insert an additional sub. A looped routine that looks at each cell in a range individually and copies it to sheet2 maybe. Here is the code I'm using for the formatting:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim rng As Range
Dim vRngInput As Variant
Set vRngInput = Intersect(Target, Range("B8:B19,D8:D19,F8:F19,H8:H19,J8:J19,L8:L19,N 8:N19"))
If vRngInput Is Nothing Then Exit Sub
For Each rng In vRngInput
'Determine the color
Select Case rng.Value
Case Is = "SSH": Num = 38
Case Is = "SMH": Num = 39
Case Is = "SSO": Num = 28
Case Is = "SKMH": Num = 36
Case Is = "SA": Num = 43
Case Is = "SBC": Num = 45
Case Is = "HC": Num = 32
Case Is = "ADMIN": Num = 54
Case Is = "OC": Num = 15
End Select
'Apply the color
rng.Interior.ColorIndex = Num
rng.Offset(0, 1).Interior.ColorIndex = Num
Next rng
End Sub
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Still trying to copy info from one sheet to another

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim rng As Range
Dim vRngInput As Variant
Set vRngInput = Intersect(Target,
Range("B8:B19,D8:D19,F8:F19,H8:H19,J8:J19,L8:L19,N 8:N19"))
If vRngInput Is Nothing Then Exit Sub
For Each rng In vRngInput
'Determine the color
Select Case rng.Value
Case Is = "SSH": Num = 38
Case Is = "SMH": Num = 39
Case Is = "SSO": Num = 28
Case Is = "SKMH": Num = 36
Case Is = "SA": Num = 43
Case Is = "SBC": Num = 45
Case Is = "HC": Num = 32
Case Is = "ADMIN": Num = 54
Case Is = "OC": Num = 15
End Select
'Apply the color
rng.Resize(1, 2).Interior.ColorIndex = Num
With Worksheets("Sheet2").Range(Target.Address)
.Value = Target.Value
.Resize(1, 2).Interior.ColorIndex = Num
End With
Next rng
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Erik" wrote in message
...
Frank,
Problem is I have code in both sheets to format the cells color based on

the text value in the cell. Using the formula in sheet2, the code doesn't
seem to recognize the value and therefore doesn't format the cell. I was
thinking there must be a way to modify my existing cell formatting code to
do the job or insert an additional sub. A looped routine that looks at each
cell in a range individually and copies it to sheet2 maybe. Here is the
code I'm using for the formatting:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim rng As Range
Dim vRngInput As Variant
Set vRngInput = Intersect(Target,

Range("B8:B19,D8:D19,F8:F19,H8:H19,J8:J19,L8:L19,N 8:N19"))
If vRngInput Is Nothing Then Exit Sub
For Each rng In vRngInput
'Determine the color
Select Case rng.Value
Case Is = "SSH": Num = 38
Case Is = "SMH": Num = 39
Case Is = "SSO": Num = 28
Case Is = "SKMH": Num = 36
Case Is = "SA": Num = 43
Case Is = "SBC": Num = 45
Case Is = "HC": Num = 32
Case Is = "ADMIN": Num = 54
Case Is = "OC": Num = 15
End Select
'Apply the color
rng.Interior.ColorIndex = Num
rng.Offset(0, 1).Interior.ColorIndex = Num
Next rng
End Sub



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
Copy Info from 1 sheet to another within same workbook Julie Excel Worksheet Functions 1 July 12th 08 12:17 AM
Copy Info from cell to another sheet Jeremy Excel Discussion (Misc queries) 2 January 19th 07 12:41 AM
copy info from another sheet Davidgg Excel Worksheet Functions 5 December 18th 06 10:04 PM
How to copy/paste info into the protected sheet Dajana Excel Discussion (Misc queries) 1 September 21st 05 04:26 PM
how do I copy info from one sheet to another via a formula? Trese Excel Worksheet Functions 6 July 28th 05 02:55 PM


All times are GMT +1. The time now is 10:47 AM.

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"