I tried to create a vba
code which helps me to identify whether Range("A1:A5")
has any number value, if it identifies the content has a number copy the Range("D10")
and paste the same value in each Range(B1:B5")
Since I am new to the vba
writing, the code I developed does not work well.
How do I solve following matter?
Sub Findvalues()
Dim rng As Range, Cell As Range
Set rng = Range("A1:A3") 'Cells data content'
For Each Cell In rng
If Cell.Value = "@" Then 'To identify whether cell has a number'
Range("A10").Select 'copy ("A10") value
Selection.Copy
Range("B1:B5").Select 'This is the line needs to be corrected'
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Next Cell
End Sub