View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default inserting formula

Dim rng as Range, cell as Range
set rng = Columns(1).Specialcells(xlConstants) ' or xlformulas
for each cell in rng
cell.offset(0,1).formula = "=if(" & cell.Address(0,0) & _
"<"""",""Filled"",""empty"")"
Next

--
regards,
Tom Ogilvy


"enyaw" wrote:

I want to insert a formula into a row if the first cell in the row has
something in it. I need to check through a range of cells but the range of
cells will be different every time. How would i program this?