#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Data Move

I have gropus of data that are imported.

Heading
Phone #
Part Name & #
etc
etc

Heading
Phone #
Part Name & #
etc
etc

Heading
Phone #
Part Name & #
etc
etc

Pattern continues for over 100 pages.
Now I want the cell "Part Name & #" to be selected and moved up to an empty
cell to the right of the cell "Heading". What from a code standpoint would
that look like in Visual Basic within a macro? I want ALL of the groupings
done in this way. They are all imported in the same patterns, so if there is
some way to select all cells with "Part Name & #" have them move up two
spaces and over 5 or 6 cells then paste, that would work. Make sense???

THANKS!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Data Move

Hi,
If I understand your question correctly, this should work. Set the range as
required.
Regards.

Sub Test()
Dim x As Variant
Dim y As Variant
For Each c In Range("A1:A20")
If c.Value = "Heading" Then
x = c.Cells.Row
y = c.Cells.Column
Cells(x, y + 1) = Cells(x + 2, y)
End If
Next
End Sub


"bodhisatvaofboogie" wrote:

I have gropus of data that are imported.

Heading
Phone #
Part Name & #
etc
etc

Heading
Phone #
Part Name & #
etc
etc

Heading
Phone #
Part Name & #
etc
etc

Pattern continues for over 100 pages.
Now I want the cell "Part Name & #" to be selected and moved up to an empty
cell to the right of the cell "Heading". What from a code standpoint would
that look like in Visual Basic within a macro? I want ALL of the groupings
done in this way. They are all imported in the same patterns, so if there is
some way to select all cells with "Part Name & #" have them move up two
spaces and over 5 or 6 cells then paste, that would work. Make sense???

THANKS!!!!

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
How do I move this data? Paul New Users to Excel 3 October 2nd 08 03:26 PM
Move data Horacio Excel Worksheet Functions 2 October 31st 06 04:14 PM
Macro to move data to different column based on data in another co malycom Excel Discussion (Misc queries) 3 August 2nd 05 07:07 PM
enter data in cell which will start macro to move data to sheet2 Tommy Excel Discussion (Misc queries) 0 May 12th 05 05:00 PM
create macro to move label type data to column data JonathonWood9 Excel Programming 4 February 21st 05 10:53 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"