View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Umlas[_3_] Bob Umlas[_3_] is offline
external usenet poster
 
Posts: 320
Default ActiveCell.Offset w/ VBA

If IsEmpty(ActiveCell.Offset(0, -1)) Then
ActiveCell.Offset(0, -1).Value =
Application.WorksheetFunction.Text(11900, "000000")
End If

You had misused Range. Range takes something like:
Range("A5")
Range("G3:G12")
etc. (many others)
Range(ActiveCell.Offset(0,-1).Value) only would mean something if
Activecell.Offset(0,1).Value were something like A5 or G3:G12, etc.
Also, you have Active.Cell rather than ActiveCell.
Also, instead of Application.WorksheetFunction.Text(11900, "000000"), use
"011900", but then you'd have to format the cell anyway!
Bob Umlas
Excel MVP


"green67beanie" wrote in message
...
I am searching down a column for a particular value and if found, want to
check the cell to the immediate left for being empty. If it is, I want to
insert a text value derived from a function, and then continue with a find
next. I am getting an error, Run time error "424" Object required, from

the
following true condition statement:

If IsEmpty(ActiveCell.Offset(0, -1)) Then
Range(Active.Cell.Offset(0, -1)).Value =
Application.WorksheetFunction.Text(11900, "000000")
End If

I initially tried the following line there, but got the same error:

Active.Cell.Offset(0, -1).FormulaR1C1 =
Application.WorksheetFunction.Text(11900, "000000")

Any suggestions?