Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a macro to import text file data into an Excel spreadsheet. Sometimes, several columns imported have blank data and can be random columns. I would like to write a macro to do the followings: 1) From column A-M, If any column along row cell 9 is blank, then delete the entire columns with blank data. Thanks for any help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub DeleteBlanks()
Range("A9:M9").SpecialCells(xlCellTypeBlanks).Enti reColumn.Delete End Sub -- HTH, Laura Cook Appleton, WI "Luong" wrote in message ... Hello, I have a macro to import text file data into an Excel spreadsheet. Sometimes, several columns imported have blank data and can be random columns. I would like to write a macro to do the followings: 1) From column A-M, If any column along row cell 9 is blank, then delete the entire columns with blank data. Thanks for any help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Laura,
Never mind my earlier reply, I got it. Thanks -----Original Message----- Hello Laura, Thanks for the tip, but I have one problem. The some unwanted columns might have some data in one of the row (example row 10 or 45). Not all the unwanted columns have blank data all the way down. That's why I like to use row 9, which is a title row. So if row 9 (on column A to M) is blank, then delete the entire column. I hope this will help in what I am trying to achieve. Thanks again. -----Original Message----- Sub DeleteBlanks() Range("A9:M9").SpecialCells (xlCellTypeBlanks).EntireColumn.Delete End Sub -- HTH, Laura Cook Appleton, WI "Luong" wrote in message ... Hello, I have a macro to import text file data into an Excel spreadsheet. Sometimes, several columns imported have blank data and can be random columns. I would like to write a macro to do the followings: 1) From column A-M, If any column along row cell 9 is blank, then delete the entire columns with blank data. Thanks for any help. . . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're welcome, glad I could help.
-- Laura Cook Appleton, WI "Luong" wrote in message ... Laura, Never mind my earlier reply, I got it. Thanks -----Original Message----- Hello Laura, Thanks for the tip, but I have one problem. The some unwanted columns might have some data in one of the row (example row 10 or 45). Not all the unwanted columns have blank data all the way down. That's why I like to use row 9, which is a title row. So if row 9 (on column A to M) is blank, then delete the entire column. I hope this will help in what I am trying to achieve. Thanks again. -----Original Message----- Sub DeleteBlanks() Range("A9:M9").SpecialCells (xlCellTypeBlanks).EntireColumn.Delete End Sub -- HTH, Laura Cook Appleton, WI "Luong" wrote in message ... Hello, I have a macro to import text file data into an Excel spreadsheet. Sometimes, several columns imported have blank data and can be random columns. I would like to write a macro to do the followings: 1) From column A-M, If any column along row cell 9 is blank, then delete the entire columns with blank data. Thanks for any help. . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I update macro to delete zero amount columns? | Excel Discussion (Misc queries) | |||
Auto Delete Columns in a Macro that are Blank | Excel Discussion (Misc queries) | |||
merge text from 2 columns into 1 then delete the old 2 columns | Excel Worksheet Functions | |||
How can I delete a macro when the Delete button is not active? | Excel Worksheet Functions | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) |