Macro to change value of 1 cell to another

Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,


I have a spreadsheet that contains colums that have a value of true or false. I want to change all the true values to the column title in cell G1. this is what I have so far:

Sub ChangeTrue()
BeginRow = 2
EndRow = 100
ChkCol = 7

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = True Then
Cells(RowCnt, ChkCol).Value = (G1)
End If
Next RowCnt
End Sub

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Why do you need macro for that

Filter the sheet on "TRUE"
and then manually type in the G1 on the fist filtered cell and just drag it down

Then you can remove the filter