ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to delete cells ? (https://www.excelbanter.com/excel-programming/332473-how-delete-cells.html)

susee

How to delete cells ?
 

undefined::undefined::

Hi All,
I would like to do the following column deletions programatically
using VBA.

In a Test.Xls file i have 5 columns and 8 rows. In the 5th column i
don't have any data in last 2 rows i,e 7th and 8th rows. I need to
delete the first 6 rows of Column A by shift cells left, so that the
whole data in the Test.Xls will be accomodated into 4 columns and 8
rows.

If :confused: Then, open an xxx.xls and then give me a solution.

Thanks in advance
:( suseee


--
susee
------------------------------------------------------------------------
susee's Profile: http://www.excelforum.com/member.php...o&userid=24510
View this thread: http://www.excelforum.com/showthread...hreadid=381041


mudraker[_325_]

How to delete cells ?
 

susee


Try this one line macro

Sub DeleteCells()
Workbook("Test.xls").Sheets(1).Range("A1:A6").Dele te Shift:=xlToLeft
End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
View this thread: http://www.excelforum.com/showthread...hreadid=381041



All times are GMT +1. The time now is 09:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com