LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Combine three InputBoxes into one?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
InputBoxes & Ranges Faraz A. Qureshi Excel Programming 5 September 13th 09 03:10 AM
Ranges & Inputboxes? Faraz A. Qureshi Excel Programming 4 September 11th 09 09:33 AM
userform and inputboxes pswanie Excel Programming 1 January 3rd 08 04:09 PM
InputBoxes Sean Excel Programming 2 July 19th 06 06:09 PM
InputBoxes Exceptions ianripping[_42_] Excel Programming 3 April 8th 04 09:34 PM


All times are GMT +1. The time now is 06:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"