View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JLatham
 
Posts: n/a
Default Macro that deletes every third row....+

This will delete entire rows (not just cells in a column) in every 3rd row as
they are numbered when it starts.

This means that #3 in your request is already taken care of.

Sub DeleteEvery3rdRow()
'presumes you're on the sheet before
'starting
Dim LastRowNowInUse As Long

LastRowNowInUse = Selection.SpecialCells(xlCellTypeLastCell).Row
Application.ScreenUpdating = False
Range("A3").Select ' go to row 3
Selection.EntireRow.Delete
'now that deleted the entire row and
'moved all others up, so we only need
'to move down 2 rows from now on
Do Until ActiveCell.Row LastRowNowInUse
ActiveCell.Offset(2, 0).Activate
Selection.EntireRow.Delete
Loop
Application.ScreenUpdating = True

End Sub

For the unnumbered #4, Yes: in cell C1 use the formula
=LEFT(B1,12)
and extend down the sheet.

working on code to include with the above to accomplish both your move from
column A to B and the 12 character copy into column C. Back later with that.

"ajjag" wrote:


I am fairly new to creating macros and am stuck on something...

Here is the sequence that I want to follow:

1. I need to delete every third starting at row 3 (3,6,9,12,etc) and
move information up
2. Cut and paste every other cell starting at A2......A300 i.e.
(2,4,6,etc) after those cells from part 1 have been moved up and moved
over to column B starting at B1 with no spaces between the information

3. Then the newly blanks cells in column A need to be moved up....

Is it then possible to take the first 12 spaces of the cells in column
B and move them over to column C?

Sorry if I put too much for a first post but I am stuck.

Thanks to anyone who can help


--
ajjag
------------------------------------------------------------------------
ajjag's Profile: http://www.excelforum.com/member.php...o&userid=35799
View this thread: http://www.excelforum.com/showthread...hreadid=555717