Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Deleting a Column from a Workbook

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Deleting a Column from a Workbook

The second line of code does not work - the formatting is
incorrect. I get an "Error 13 - Type Mismatch." Any
suggestions on how to get the cloumn deleted?

-----Original Message-----
Change

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

with

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

--
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.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Deleting a Column from a Workbook

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

--
Regards

Juan Pablo González

"Terry" wrote in message
...
The second line of code does not work - the formatting is
incorrect. I get an "Error 13 - Type Mismatch." Any
suggestions on how to get the cloumn deleted?

-----Original Message-----
Change

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

with

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

--
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.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Deleting a Column from a Workbook

Muy Bien!
Gracias.

-----Original Message-----
Workbooks("Test.xls").Sheets("YourSheet").Range

("A1").EntireColumn.Delete

--
Regards

Juan Pablo González

"Terry" wrote in

message
...
The second line of code does not work - the formatting is
incorrect. I get an "Error 13 - Type Mismatch." Any
suggestions on how to get the cloumn deleted?

-----Original Message-----
Change

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

with

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

--
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.



.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting workbook saqib New Users to Excel 1 June 24th 08 03:22 PM
Deleting Workbook from others Julia Excel Worksheet Functions 2 April 22nd 08 06:34 PM
deleting macros that are not really in my workbook? mydogpeanut Excel Worksheet Functions 1 November 22nd 05 10:42 PM
How do I prevent someone from deleting a workbook? JSP Excel Discussion (Misc queries) 5 September 5th 05 04:51 PM
Deleting Workbook Fred[_16_] Excel Programming 2 November 26th 03 06:33 PM


All times are GMT +1. The time now is 11:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"