Need Help for Autofill

mu4you

New Member
Joined
Apr 13, 2008
Messages
16
My Data as follows:

In A1 - "Simens Limited"
In A2 - 04-1783-933 (entered as text)
In A3 - 04-7873-321 (text)

In A4 - Sisco Limited
In A5 - 05-898-aa-88 (entered as text)
In A6 - 05-883-bb-99 (entered as text)

Now, I need output as follows:

In A1 - Simens Limited and in B1 04-1783-933
In A2 - Simens Limited and in B2 04-7873-321

In A3 - Sisco Limited and in A3 05-898-aa-88
In A4 - Sisco Limited and in A4 05-883-bb-99

I really appreciate if anybody can help because this is large data.

Thanks in advance and waiting for your reply.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Is all your data in column A and always in the pattern of 3's like below (e.g. header, then text, then text)?

If so, maybe this code can help:
Code:
Sub MyPenguinsWillConquerAll ()
 
Dim i as Long, j as Long
 
With Application
  .Calculation = xlCalculationManual
  .ScreenUpdating = False
End With
 
j = 1
 
For i = 1 to Range("A" & Rows.Count).End(xlUp).Row Step 3
  Range("B" & j) = Range("A" & i)
  Range("B" & j + 1) = Range("A" & i)
  Range("C" & j) = Range("A" & i + 1)
  Range("C" & j + 1) = Range("A" & i + 2)
  j = j + 2
Next i
 
Columns("A:A").Delete Shift:=xlToLeft
 
With Application
  .Calculation = xlCalculationAutomatic
  .ScreenUpdating = True
End With
 
End Sub
 
Upvote 0
For instance:

Code:
Sub ff()
    Dim lCounter As Long
    lCounter = 1
    For i = 1 To Range("A" & Rows.Count).End(xlUp).Row Step 3
        Range("B" & lCounter).Resize(2) = Range("A" & i).Value
        Range("C" & lCounter).Resize(2) = Range("A" & i + 1).Resize(2).Value
        lCounter = lCounter + 2
    Next
    Columns(1).Delete
End Sub]
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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