Hello
Thank you for reading my post.
I will try to explain my issue as clearly as i can.
A have a range on a spreadsheet which a macro pastes a value only for another spreadsheet.
This range is (b11:ah57)
in range (d60:ah60) there is numeric values ( between 1 to 7 )
What i need is if the cell value in the range (d60:ah60) is either 1 or 7 then any blank cell in that column in the range B11:ah57 will put W in it, any cell which has a value in it is left alone.
I have made this macro below but will not fill it out, but if i clear all (b11:ah57) it works. I think it might be something on the value only paste even though when the cell is checked it is blank.
any help will be greatly appreciated
Mnay Thanks
Dave
Sub weekends()
Dim cell As Range, raTest As Variant
For Each cell In Range("d60:ah60")
If cell = 7 Or cell = 1 Then
On Error Resume Next
Set raTest = Range(cell.Offset(-49, 0), cell.Offset(-4, 0)).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If IsEmpty(raTest) = False Then
raTest.Value = "W"
End If
End If
Next
End Sub
Thank you for reading my post.
I will try to explain my issue as clearly as i can.
A have a range on a spreadsheet which a macro pastes a value only for another spreadsheet.
This range is (b11:ah57)
in range (d60:ah60) there is numeric values ( between 1 to 7 )
What i need is if the cell value in the range (d60:ah60) is either 1 or 7 then any blank cell in that column in the range B11:ah57 will put W in it, any cell which has a value in it is left alone.
I have made this macro below but will not fill it out, but if i clear all (b11:ah57) it works. I think it might be something on the value only paste even though when the cell is checked it is blank.
any help will be greatly appreciated
Mnay Thanks
Dave
Sub weekends()
Dim cell As Range, raTest As Variant
For Each cell In Range("d60:ah60")
If cell = 7 Or cell = 1 Then
On Error Resume Next
Set raTest = Range(cell.Offset(-49, 0), cell.Offset(-4, 0)).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If IsEmpty(raTest) = False Then
raTest.Value = "W"
End If
End If
Next
End Sub