ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Then Statement in VBA (https://www.excelbanter.com/excel-programming/332769-if-then-statement-vba.html)

John

If Then Statement in VBA
 
If Range("n6").Value.Len = 3 Then SendKeys "{F2}" Else: SendKeys "{F10}"
End If

Can someone help with this statment...

Ron Coderre[_5_]

If Then Statement in VBA
 
Try this:

If Len(Range("n6").Value) = 3 Then
SendKeys "{F2}"
Else:
SendKeys "{F10}"
End If

Does that help?
--
Regards,
Ron


John

If Then Statement in VBA
 
Thanks!

"Ron Coderre" wrote:

Try this:

If Len(Range("n6").Value) = 3 Then
SendKeys "{F2}"
Else:
SendKeys "{F10}"
End If

Does that help?
--
Regards,
Ron



All times are GMT +1. The time now is 05:13 PM.

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