Macro to change value of 1 cell to another

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