how to prompt user to click on cell for starting import position

  • Thread starter Thread starter AlanN
  • Start date Start date
A

AlanN

How would this be changed so that when the macro is run, it prompts the user to click on the cell to start copying in the data?

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(41, 1), Array(82, 1), Array(90, 1), Array(131, 1), _
Array(143, 1), Array(169, 1), Array(191, 1), Array(203, 1), Array(216, 1), Array(238, 1), _
Array(250, 1), Array(262, 1))


TIA, AlanN
 
Hi Alan

Sub test()
Dim R As Range
On Error Resume Next
Set R = Application.InputBox("Click a cell", Type:=8)
If R Is Nothing Then Exit Sub
MsgBox R.Address 'replace with
'Selection.TextToColumns Destination:=R, and the rest as is
End Sub

--
HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.

How would this be changed so that when the macro is run, it prompts the user to click on
the cell to start copying in the data?

Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(41, 1), Array(82, 1), Array(90, 1), Array(131,
1), _
Array(143, 1), Array(169, 1), Array(191, 1), Array(203, 1), Array(216, 1),
Array(238, 1), _
Array(250, 1), Array(262, 1))


TIA, AlanN
 
Back
Top