Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete all of collumn after cell...


Alright, we all know how to do this. How do I put it into code?
This is what my employer told me.

1. go to the column B
2. hit <end <down and it goes to the last student.
3. hit <Down arrow once more (puts cursor below last active record).
4. Select EVERY row from there to <end<Down (bottom of exce
sheet)
5. <right click and DELETE


How on earth do I do this in VBCode

--
Zlor
-----------------------------------------------------------------------
Zlord's Profile: http://www.excelforum.com/member.php...fo&userid=2751
View this thread: http://www.excelforum.com/showthread.php?threadid=48028

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Delete all of collumn after cell...

try recording a macro as you perform the steps

--


Gary


"Zlord" wrote in
message ...

Alright, we all know how to do this. How do I put it into code?
This is what my employer told me.

1. go to the column B
2. hit <end <down and it goes to the last student.
3. hit <Down arrow once more (puts cursor below last active record).
4. Select EVERY row from there to <end<Down (bottom of excel
sheet)
5. <right click and DELETE


How on earth do I do this in VBCode?


--
Zlord
------------------------------------------------------------------------
Zlord's Profile:
http://www.excelforum.com/member.php...o&userid=27519
View this thread: http://www.excelforum.com/showthread...hreadid=480285



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete all of collumn after cell...


Hello Zlord,

Like this...

FIND THE NEXT CELL AFTER THE LAST RECORD..
StartCell = Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).Address

FIND THE LAST CELL ON THE WORKSHEET..
LastCell = Cells(Rows.Count, "B").Address

SELECT THE THE CELLS TO BE DELETED..
Range(StartCell, LastCell).Select

DELETE THE CELLS..
Selection.Delete[/color]

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=48028

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
counting if data from one collumn is present in another collumn Amelia Excel Worksheet Functions 1 February 8th 07 10:05 PM
looking for a value in a collumn exceluser2 Excel Worksheet Functions 5 February 8th 06 11:53 PM
Looking up data within a collumn Demitre Excel Discussion (Misc queries) 3 December 21st 05 01:08 AM
Last record in collumn. Tom Excel Programming 3 September 6th 05 03:49 PM
Find a value in the collumn and then in that row OxanaB Excel Programming 2 December 2nd 04 06:01 PM


All times are GMT +1. The time now is 09:45 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"