Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Howard,
Am Sat, 24 May 2014 07:48:19 -0700 (PDT) schrieb L. Howard: Works perfect. I changed the code that it also works in columns with two or three letters. The first code only works until column Z: Sub TransformCol() Dim Info As String Dim LRow As Long, i As Long, j As Long Dim arrOut As Variant Dim arrInfo As Variant Dim StartCol As Long Info = Application.InputBox("Enter the number of rows," _ & "the source column and the target column comma separated", _ "Infos", Type:=2) If Info = "" Or Info = "False" Then Exit Sub arrInfo = Split(Info, ",") StartCol = Columns(arrInfo(2)).Column With Sheets("Sheet2") LRow = .Cells(Rows.Count, arrInfo(1)).End(xlUp).Row For i = 1 To LRow Step arrInfo(0) arrOut = .Range(.Cells(i, UCase(arrInfo(1))), _ .Cells(i + arrInfo(0) - 1, UCase(arrInfo(1)))) Sheets("Sheet3").Cells(1, StartCol + j) _ .Resize(rowsize:=arrInfo(0)) = arrOut j = j + 1 Next End With End Sub Regards Claus B. -- Vista Ultimate / Windows7 Office 2007 Ultimate / 2010 Professional |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
InputBoxes & Ranges | Excel Programming | |||
Ranges & Inputboxes? | Excel Programming | |||
userform and inputboxes | Excel Programming | |||
InputBoxes | Excel Programming | |||
InputBoxes Exceptions | Excel Programming |