ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Working with a cell in a selected row (https://www.excelbanter.com/excel-programming/309653-working-cell-selected-row.html)

kls[_2_]

Working with a cell in a selected row
 


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!

Dave Peterson[_3_]

Working with a cell in a selected row
 
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



kls wrote:

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!


--

Dave Peterson


Jim May

Working with a cell in a selected row
 

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


"kls" wrote in message
...


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!





All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com