How to copy & paste cell value multiple times using vb or formula in excel
Hi i have following column in xl:
Col : C
Motor-1
Motor-2
Motor-3
Motor-4
Motor-5
Motor-6
Motor-7
Motor-8
Column : D
Int-1
Int-2
Int-3
Int-4
I need following op:
Motor-1\Int-1
Motor-1\Int-2
Motor-1\Int-3
Motor-1\Int-4
Motor-2\Int-1
Motor-2\Int-2
Motor-2\Int-3
Motor-2\Int-4
Motor-3\Int-1
Motor-3\Int-2
Motor-3\Int-3
Motor-3\Int-4
Any help really appreciate
Excel VB
Re: How to copy & paste cell value multiple times using vb or formula in excel
Thread moved from the 'VB.Net' forum to the 'Office Development/VBA' forum.
Re: How to copy & paste cell value multiple times using vb or formula in excel
This code assumes no headings in columns C and D, and that the data starts in row 1 and there are not blank rows within, and puts the resulting combinations in row E:
Code:
Sub combos()
Dim ws As Worksheet
Dim c As Integer
Dim d As Integer
Dim e As Long
Dim cNumb As Integer
Dim dNumb As Integer
Dim eNumb As Long
Application.ScreenUpdating = False
Set ws = ActiveSheet
With ws
cNumb = .Range("c1").End(xlDown).Row
dNumb = .Range("d1").End(xlDown).Row
For c = 1 To cNumb
For d = 1 To dNumb
eNumb = eNumb + 1
.Range("e" & eNumb).Value = .Range("c" & c).Value & "\" & .Range("d" & d).Value
Next d
Next c
End With
End Sub
Re: How to copy & paste cell value multiple times using vb or formula in excel
Thank you. @ vbfbryce
Working Superfast:):D:)
Re: How to copy & paste cell value multiple times using vb or formula in excel