Working with a cell in a selected row

K

kls

If having selected Row 5, I want my macro to evaluate Range("C5')'s
value. If it is found that it is equal to "", I want to then make it
equal to Range("D17")'s value.

Hope this is clear

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
D

Dave Peterson

I'm not sure why row 5 being selected makes a difference.

but one way:

with activesheet
if .range("c5").value = "" then
.range("c5").value = .range("d17").value
end with
 
J

Jim May

Click any Row Header and then Run:

Sub tester()
With Selection
If .Columns(3).Value = "" Then
.Columns(3).Value = Range("D17").Value
End If
End With
End Sub

Careful with the Hard-coded D17 Reference Above;

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top