Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing two Cells - using Offset and compare - Stuck!!!!
What is the easist way to compare the values of two adjacent cells? I need to check the value of the active cell and the cell to the right of it (i can use the offset for that). If the numerical value of the cell to the right is greater, than I trigger an alert. Simple stuff, but I am not totally sure how to define the cell to the right using the offset and then compare the values. Any help would be greatly appreciated. Thank you
Dou Example If A1 is less than B1 (A1 < B1) then I show a user form The active cell in this case would be A1. I need to figure out code to calculate the offset (to B1) and then compare the values. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing two Cells - using Offset and compare - Stuck!!!!
Doug,
Sub testit() Dim rng As Range Set rng = Range("A1") If rng.Value < rng.Offset(0, 1).Value Then MsgBox "show form" End If End Sub Rob "Doug" wrote in message ... What is the easist way to compare the values of two adjacent cells? I need to check the value of the active cell and the cell to the right of it (i can use the offset for that). If the numerical value of the cell to the right is greater, than I trigger an alert. Simple stuff, but I am not totally sure how to define the cell to the right using the offset and then compare the values. Any help would be greatly appreciated. Thank you. Doug Example: If A1 is less than B1 (A1 < B1) then I show a user form. The active cell in this case would be A1. I need to figure out code to calculate the offset (to B1) and then compare the values. Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing two Cells - using Offset and compare - Stuck!!!!
if ActiveCell.Value < ActiveCell.offset(0,1).Value then _
userform1.show -- Regards, Tom Ogilvy Doug wrote in message ... What is the easist way to compare the values of two adjacent cells? I need to check the value of the active cell and the cell to the right of it (i can use the offset for that). If the numerical value of the cell to the right is greater, than I trigger an alert. Simple stuff, but I am not totally sure how to define the cell to the right using the offset and then compare the values. Any help would be greatly appreciated. Thank you. Doug Example: If A1 is less than B1 (A1 < B1) then I show a user form. The active cell in this case would be A1. I need to figure out code to calculate the offset (to B1) and then compare the values. Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing two Cells - using Offset and compare - Stuck!!!!
Rob/Tom
Thank you so much. That worked like a charm Doug |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stuck! Moving cells to the right | Excel Discussion (Misc queries) | |||
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul | Excel Worksheet Functions | |||
Compare side by side stuck | Excel Worksheet Functions | |||
comparing two spreadsheets using vlookup and compare | Excel Worksheet Functions | |||
How do I compare cells and if FALSE compare to next cell in EXCEL | Excel Worksheet Functions |