Deleting a Column

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

In a macro in workbook A I am trying to delete column A in
workbook SOA.xls. This code doesn't seem to work.

Windows("SOA.xls").Columns("A").Delete

What is worng with this syntax?

TIA.
 
What sheet? Workbooks or Windows don't have a Columns collection for you
delete anything from. Worksheets do.

Workbooks("SOA.xls").ActiveSheet.Columns("A").Delete
Workbooks("SOA.xls").Worksheets(1).Columns("A").Delete
Workbooks("SOA.xls").Worksheets("Sheet 1").Columns("A").Delete

should all work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top