ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Target.Offset(0, 36).Value Help (https://www.excelbanter.com/excel-discussion-misc-queries/260452-target-offset-0-36-value-help.html)

Matt

Target.Offset(0, 36).Value Help
 
In the below, I use this to force the persons USERNAME to populate 36 rows to
the right in a column I hide. This shows me who was in a spreadsheet and
updating ONE specific column... Column AD. My question is this... Can I
poulate a named range with their USERNAME. I want to insert a named range,
then force the USERNAME there. (INSERTNAMEDEFINE)



Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const myRange As String = "ad7:AD90"
'Const myrange As String = "A3,A6,A8,A11,A16"
On Error GoTo stoppit
Application.EnableEvents = False
If Intersect(Target, Me.Range(myRange)).Value < "" Then
Target.Offset(0, 36).Value = Environ("USERNAME")
Else
If Intersect(Target, Me.Range(myRange)).Value = "" Then
Target.Offset(0, 36).Value = ""
End If
End If
stoppit:
Application.EnableEvents = True
End Sub



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com