zermrodrigues
New Member
- Joined
- Jan 21, 2025
- Messages
- 1
- Office Version
- 2024
- Platform
- Windows
Dear all,
I have been trying to adapt a macro to suit my purposes but cannot make the macro to add data on more that once cell. What I want is when the cell value on the column B is "Office" then the macro should write "TAG/IN" on the column F (which I have managed to get) and also "TAG/OUT" on the column N in the same line as the "Office" value shows up. I have been using this macro:
Can anyone halp me with this? Thank you. Kind regards, Jose
I have been trying to adapt a macro to suit my purposes but cannot make the macro to add data on more that once cell. What I want is when the cell value on the column B is "Office" then the macro should write "TAG/IN" on the column F (which I have managed to get) and also "TAG/OUT" on the column N in the same line as the "Office" value shows up. I have been using this macro:
VBA Code:
Sub Fill_F_column()
Dim Rng As Range
Dim T&, Lr&, S$
Application.ScreenUpdating = False
Lr = Range("B" & Rows.Count).End(xlUp).Row
For T = Lr To 2 Step -1
If Range("B" & T) = "Office" And Range("F" & T) = "" Then S = S & ",F" & T
If S <> "" Then
If Len(S) > 240 Or T = 2 Then Range(Mid(S, 2)) = "TAG/IN": S = ""
End If
Next T
Application.ScreenUpdating = True
End Sub
Can anyone halp me with this? Thank you. Kind regards, Jose
Last edited by a moderator: