Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie's question.
Hi everybody,
I don't know how to compare 2 cells. If I refered to a cell, like A1 and compare it to D1, how I must write the line because my loop will always referd to A1. I have the same problem when I want to insert a partial row, it will be always at D1:G1. Sub Macro1() Range("a1").Activate Do until ActiveCell.Value <0.01 'Cell A1 = cell D1? If Range("a1") = Range("d1") Then 'Cell B1 = cell E1? If Range("b1") = Range("e1") Then 'Cell C1 = cell F1? If Range("c1") = Range("f1") Then 'Return to A2 ActiveCell.Offset(1, 0).Select End If End If Else: Range(d1:g1).Activate 'Insert a partial row at D1:G1 to move date Selection.Insert Shift:=xlDown 'Go to G1 and write Change ActiveCell.Offset(0, 4).Select ActiveCell.FormulaR1C1 = "Change" End If Loop End Sub Thanks for your help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
where can I see my question and answer? Yesterday I ask a question | Excel Discussion (Misc queries) | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions | |||
Newbie's macro doesn't appear to work! | Excel Programming |