ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If greater Then (https://www.excelbanter.com/excel-programming/440172-if-greater-then.html)

Helmut

If greater Then
 
This is not working...

If Range("F2").Value "109" Then

I have a Workbook_Open macro which has to check if the value in F2 is
greater than 109 then do a routine, if Value of F2 is 'empty' then end macro

thanks

Mike H

If greater Then
 
Hi,

Try it like this

Private Sub Workbook_Open()
Set sht = Sheets("Sheet1")
If sht.Range("F2").Value 109 Then
Call mymacro
End If

End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Helmut" wrote:

This is not working...

If Range("F2").Value "109" Then

I have a Workbook_Open macro which has to check if the value in F2 is
greater than 109 then do a routine, if Value of F2 is 'empty' then end macro

thanks



All times are GMT +1. The time now is 12:03 PM.

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