Moving data from a single column to get more row values to work with

Onebracketshort

New Member
Joined
Dec 19, 2019
Messages
37
Office Version
  1. 2010
Platform
  1. Windows
Have a series of data in one column I'm trying to make easier to work with.

Looking to move the date entry in A3 to B4
Looking to move the vehicle entry value in A2 to C4

Similarly looking to move date entry in A8 to B9
looking to move vehicle entry A7 to C9

These moves are to be repeated for several thousand rows in total.

The vehicle value in column A is category general.
The date entry in column A is category custom dd-mmm-yy
The time entry in column A is category custom hh:mm

XL2BB capture:

Book1
ABC
1DateVehicle
2Lorry
303-Aug-20
421:47
522:03
611:16
7Coach
804-Aug-20
921:35
1022:37
1123:43
12Tractor
1305-Aug-20
1419:15
1519:57
Sheet2 (2)


Thanks for taking a look and for any pointers or solutions
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
OK, try this version. Assumes nothing in columns B:C below row 1.

VBA Code:
Sub rearrange_v2()
  Dim a As Variant
  Dim i As Long
 
  a = Range("A2", Range("A" & Rows.Count).End(xlUp)).Resize(, 3).Value
  For i = 1 To UBound(a)
    If IsDate(a(i, 1)) Then
      a(i + 1, 2) = a(i, 1)
      a(i, 1) = vbNullString
    ElseIf Not IsNumeric(a(i, 1)) Then
      a(i + 2, 3) = a(i, 1)
      a(i, 1) = vbNullString
    End If
  Next i
  Range("A2").Resize(UBound(a, 1), UBound(a, 2)).Value = a
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top