dramqueenuk
New Member
- Joined
- Sep 22, 2020
- Messages
- 21
- Office Version
- 2016
- Platform
- Windows
I have data being submitted on a sheet called, "Overview".
I am wanting to use VBA to find the corresponding user name and update columns J and V with the new data.
This code ran the first time correctly.
The 2nd time, it put the data in columns K and W, not J and V.
The 3rd time, it gives a 'Range' of object '_Global' failed error and continues to do so on the first Fnd.Offset row.
What have I done wrong?
I'd also like to add conditional formatting so that when this data is submitted, the whole row changes to grey in colour, but the code I've tried so far isn't working, so if anyone has a suggestion for that, it'd be really helpful!
I am wanting to use VBA to find the corresponding user name and update columns J and V with the new data.
This code ran the first time correctly.
The 2nd time, it put the data in columns K and W, not J and V.
The 3rd time, it gives a 'Range' of object '_Global' failed error and continues to do so on the first Fnd.Offset row.
What have I done wrong?
I'd also like to add conditional formatting so that when this data is submitted, the whole row changes to grey in colour, but the code I've tried so far isn't working, so if anyone has a suggestion for that, it'd be really helpful!
VBA Code:
Sub Offline_VNHO_Form()
Dim Fnd As Range
Set Fnd = Sheets("Dashboard").Range("A:A").Find(Range("User_ID_Offline_VNHO").Value, , , xlWhole, , , False, , False)
If Fnd Is Nothing Then
MsgBox Range("User_ID_Offline_VNHO").Value & " not found"
Exit Sub
End If
Fnd.Offset(, 10).Value = Range("Offline_VNHO_Date").Value
Fnd.Offset(, 22).Value = Range("Offline_VNHO_Reason").Value
End Sub