View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_5_] Bob Phillips[_5_] is offline
external usenet poster
 
Posts: 620
Default Insert colum with 0's

Struggling on that one. It's so simple it's difficult to see where that
error could arise. I don't get it, and as Tom says, it worked for him.

Any other details?

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"JMay" wrote in message news:ScoSa.2767$If5.298@lakeread06...
Bob:
I get Compile error - Sub or Function not defined, when trying this; Can
you review and comment on the possibilities??
Tks,
JMay

"Bob Phillips" wrote in message
...
Henrik,

This inserts the column after D

Sub InsertColumn()
Dim cRows As Long

cRows = Cells(Rows.Count, "D").End(xlUp).row
Columns("E:E").EntireColumn.Insert
Range("E1:E" & cRows).Value = "0"
End Sub


--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Henrik Bonde" wrote in message
...
Hi
During execution of a macro converting a *.xls to *.txt, i need to
insert a colum containing only zeros.
But it has to be the same length (number of rows), as the colum next
to it.

How to?

Best Regards
Henrik Bonde