Macro to change value of 1 cell to another

Closed
tindall - 4 Aug 2010 à 11:46
rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 - 5 Aug 2010 à 07:47
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
Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday 28 January 2010 Status Contributor Last seen 5 May 2022 766
5 Aug 2010 à 07:47
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