Dear All,
I am using the coding below to put value entered in aux data into all sheets that I require, the problem is I have to use the offset button to revert to the cell that was changed, this only works if someone enters data and then presses return, if they just use a right arrow it will not work on the correct cell, is there a way to know which cell was changed and then put this in all the other sheets, I have given part of the case select coding here.
If Not Intersect(Target, Range("b5:Af51"
) Is Nothing Then
UserSel2 = ActiveWindow.RangeSelection.Offset(-1, 0).Address
userval2 = ActiveWindow.RangeSelection.Offset(-1, 0).Value
Dim UserSheet As Worksheet, sht As Worksheet
Dim UserSel As String
Set UserSheet = ActiveSheet
Application.ScreenUpdating = False
Select Case UCase(Target.Text)
Case "DO"
If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
' Remember the current sheet
' Store info from the active sheet
UserSel = UserSel2
userval = userval2
' Loop through the worksheets
For Each sht In ActiveWorkbook.Worksheets
If sht.Name <> "Agent Info" Then
If sht.Name <> "Welcome" Then
If sht.Name <> "Aux Data" Then
If sht.Name <> "Monitoring" Then
If sht.Visible Then 'skip hidden sheets
sht.Activate
sht.Range(UserSel).Select
ActiveCell.Value = userval
sht.Range(UserSel).Interior.ColorIndex = 37
End If
End If
End If
End If
End If
Next sht
' Restore the original position
UserSheet.Activate
Any help on this would be greatly appreciated.
Thanks Rob.![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)
I am using the coding below to put value entered in aux data into all sheets that I require, the problem is I have to use the offset button to revert to the cell that was changed, this only works if someone enters data and then presses return, if they just use a right arrow it will not work on the correct cell, is there a way to know which cell was changed and then put this in all the other sheets, I have given part of the case select coding here.
If Not Intersect(Target, Range("b5:Af51"
UserSel2 = ActiveWindow.RangeSelection.Offset(-1, 0).Address
userval2 = ActiveWindow.RangeSelection.Offset(-1, 0).Value
Dim UserSheet As Worksheet, sht As Worksheet
Dim UserSel As String
Set UserSheet = ActiveSheet
Application.ScreenUpdating = False
Select Case UCase(Target.Text)
Case "DO"
If TypeName(ActiveSheet) <> "Worksheet" Then Exit Sub
' Remember the current sheet
' Store info from the active sheet
UserSel = UserSel2
userval = userval2
' Loop through the worksheets
For Each sht In ActiveWorkbook.Worksheets
If sht.Name <> "Agent Info" Then
If sht.Name <> "Welcome" Then
If sht.Name <> "Aux Data" Then
If sht.Name <> "Monitoring" Then
If sht.Visible Then 'skip hidden sheets
sht.Activate
sht.Range(UserSel).Select
ActiveCell.Value = userval
sht.Range(UserSel).Interior.ColorIndex = 37
End If
End If
End If
End If
End If
Next sht
' Restore the original position
UserSheet.Activate
Any help on this would be greatly appreciated.
Thanks Rob.
![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)