View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
helenmacduff helenmacduff is offline
external usenet poster
 
Posts: 1
Default cant add a column in vb code


I have opened a spreadsheet and am trying to add a column

if I use the following

selection.Insert Shift:=xlToRight

this works on the first iteration but fails on the second with the
following error
object variable or with block not set.

If i try the following

xlWks.Columns.Insert Shift:=xlToRight i get the message
cannot shift non blank cells off worksheet.

However the worksheet is off limited size (36 rows and 20 columns) and
is
borfered by blank cells none of which have associated formula


--
helenmacduff
------------------------------------------------------------------------
helenmacduff's Profile: http://www.excelforum.com/member.php...o&userid=29020
View this thread: http://www.excelforum.com/showthread...hreadid=487525