View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Juan Pablo González Juan Pablo González is offline
external usenet poster
 
Posts: 226
Default Deleting a Column from a Workbook

Change

Workbooks("Test.xls").Range("A1")

with

Workbooks("Test.xls").Sheets("YourSheet").Range("A 1")

--
Regards

Juan Pablo González

"Terry" wrote in message
...
We want to delete a column in a workbook without
activating the workbook. The code below is supposed to
check whether cell A1 is null. If it is, we want to delete
column A from the workbook without activating that
workbook, but can't get the syntax right. (The Test
workbook has only one workshet.)

If Workbooks("Test.xls").Range("A1") = "" Then
Workbooks("Test.xls").Columns("A").Delete
End If

Help, please.

Thanks.