View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Insert cell from an if statement

Sub foo()
With ActiveSheet
If Range("A2").Value < Range("A1").Value Then
Range("A2").Offset(1, 0).Insert Shift:=xlDown
End If
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 12 Jul 2007 08:38:15 -0700, Billing Goddess
wrote:

I'm not sure how it would work with a macro. I am comparing two cells and if
they match then nothing happens, if they don't match, then the statement
would force a new cell to be entered, thus shifting the cells below down.