Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default macro beginner

Hi Erica

You need to give us some more details. Which column is your data in? Does it
start in row 1 or do you have headings? Are you sure you want to move the 3rd
row up one or do you want to move it up 2 rows to be in the same row as the
other data?

Assuming your data is in column A starting in row 1 and you want your
results on one line then this should work.

Sub Move()

Dim lRow As Long
Dim myCol As Range
Dim Cell As Range

lRow = Cells(Rows.Count, 1).End(xlUp).Row
Set myCol = Range(Cells(1, 1), Cells(lRow, 1))
For Each Cell In myCol
Select Case Cell.Row Mod 3
Case 2
Cell.Offset(-1, 1).Value = Cell.Value
Cell.Value = ""
Case 0
Cell.Offset(-2, 2).Value = Cell.Value
Cell.Value = ""
End Select
Next Cell

End Sub

Regards
Rowan


"Erica" wrote:

Hi, I would like a macro that from one column cuts and pasts from every 2nd
row into the next (2nd) column (one row up) and that for every 3rd row cuts
and past that value into the 3rd column (also one row up). I have recorded
the macro but the cell values are fixed. Thanks!

Erica

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
Macro for a beginner Masha Excel Discussion (Misc queries) 2 February 14th 06 06:42 AM
macro help for a beginner Danz[_4_] Excel Programming 2 November 15th 04 07:19 PM
macro help for a beginner Danz[_3_] Excel Programming 1 November 15th 04 07:51 AM
macro help for a beginner Danz[_2_] Excel Programming 0 November 14th 04 10:56 AM
macro help for a beginner Danz Excel Programming 2 November 14th 04 10:20 AM


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

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"