R
Richard
I posted this a couple of days ago but it has still stumped me. I'm
trying to open an external workbook, select a sheet and select a
column in order to insert a new column.
My problem is that instead of selecting column F, it selects
some whole Columns "B:K". The problem is on the
With Sht
..colums("F:F".Select
line
Instead of just selecting column F, it selects the range B:K. It does
exactly the same thing whether I use the Columns("F"), or Columns(6)
syntax.
Here is what I am using:-
Set wkb = Workbooks..Open(strWorkbook)
wkb.activate
set sht = wkb("MySheet")
With sht
.activate
.columns("F:F").select ' problem seems to be here.
.columns.Insert xlToRight
Set rng = .range("F5:F15").select
For each cell in rng
cell.select
cell.value = 0
Next cell
End With
As I step through the code (from a module in another workbook) it
doesn't do what it says on the tin.
Richard
Its a good job Einstein never had to fill out one of these Government Grant applications or we never would have found out what e equalled. The West Wing
trying to open an external workbook, select a sheet and select a
column in order to insert a new column.
My problem is that instead of selecting column F, it selects
some whole Columns "B:K". The problem is on the
With Sht
..colums("F:F".Select
line
Instead of just selecting column F, it selects the range B:K. It does
exactly the same thing whether I use the Columns("F"), or Columns(6)
syntax.
Here is what I am using:-
Set wkb = Workbooks..Open(strWorkbook)
wkb.activate
set sht = wkb("MySheet")
With sht
.activate
.columns("F:F").select ' problem seems to be here.
.columns.Insert xlToRight
Set rng = .range("F5:F15").select
For each cell in rng
cell.select
cell.value = 0
Next cell
End With
As I step through the code (from a module in another workbook) it
doesn't do what it says on the tin.
Richard
Its a good job Einstein never had to fill out one of these Government Grant applications or we never would have found out what e equalled. The West Wing