ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Comparing two cells (https://www.excelbanter.com/excel-programming/431736-comparing-two-cells.html)

Geoff

Comparing two cells
 
Hi,

Im very new to VB and would appreciate some help.

I need some code which compares two cells (AH1 & AI1) and if there is a
difference then the code runs a Macro (called DisplayCalendar)

Thanks


K[_2_]

Comparing two cells
 
Copy below code in Worksheet Module (Right click on Tab , Click on
"View Code" , Paste below code)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("AH1").Value < Range("AI1").Value Then
Call DisplayCalendar
End If
End Sub

Regards


All times are GMT +1. The time now is 09:50 AM.

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