Movind data from one cell to another via a Macro

Closed
mpstockdale Posts 2 Registration date Monday September 8, 2014 Status Member Last seen September 9, 2014 - Sep 8, 2014 at 04:54 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 10, 2014 at 01:46 AM
Hello all--

I am in need of someone's valued assistance. Here's the story:

I have an excel spreadsheet that contains address data in Cell B6 & B7. I want to move the data from Cell B7 to C6 and then have B7 now show a blank value. I have about 400 records like this, which is why I am hoping for some help here.

In case you were wondering, Rows 1 - 4 are used for a graphic, and Row 5 contains my header values, so the first row of data is row 6. Take a look at the picture below.



If this is something you can help me out with that would be awesome! Thank you in advance for any assistance rendered.

Marty
Related:

3 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Sep 9, 2014 at 12:30 AM
where are the 400 records are they In B7,B8,B9,B10 etc

suppose last row is 406

then select B7:B406
click edit cut (control +X)
select C6 and click edit paste (or control V)


SAVE ORIGINAL FILE SOMEWHERE SO THAT THE ORIGINAL DATA CAN BE RETRIEVED IF SOME THING GOES WRONG
0
mpstockdale Posts 2 Registration date Monday September 8, 2014 Status Member Last seen September 9, 2014
Sep 9, 2014 at 09:25 AM
It's not a simple cut and paste I need. Please see example below.

NOW
B6 = Data-1a
B7 = Data-1b
B8 = Data-2a
B9 = Data-2b
B10 = Data-3a
B11 = Data-3b
B12 = Data-4a
B13 = Data-4b

WHAT I WANT
B6 = Data-1a C6 = Data-1b
B8 = Data-2a C8 = Data-2b
B10 = Data-3a C10 = Data-3b
B12 = Data-4a C12 = Data-4b

Thanks, though, for your assistance.

Marty
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Sep 10, 2014 at 01:46 AM
try this macro (KEEP ORIGINAL DATA SOMEWHERE SAFE FOR RETRIEVAL IF SOMETHING GOES WRONG)


Sub test()
Dim r As Range, c As Range
Worksheets("sheet1").Activate
Set r = Range(Range("B6"), Range("B6").End(xlDown))
For Each c In r
If c.Row Mod 2 = 1 Then c.Cut Destination:=c.Offset(-1, 1)
Next c
Range(Range("B6"), Cells(Rows.Count, "C").End(xlUp)).Sort key1:=Range("c6")
End Sub
0