DerekK
Board Regular
- Joined
- Jun 18, 2007
- Messages
- 90
- Office Version
- 2003 or older
- Platform
- Windows
Good day,
I've been trying for hours to figure this out (yes, including myriad Google search criteria permutations), I hope you can help!
I simply want to 'Text to Columns' with the cell which contains the data in one workbook but with the destination range in another workbook.
Although it the solution doesn't necessarily need to be in the form of VBA, I have made a rudimentary stab at it but it wants to make the destination range, the same sheet that contains the data cell.
Specifically, I need to start out in a cell inside a template workbook (A); select the cell which contains the data in another workbook (B); and have the destination be the original 'active' cell in the template workbook (B). There is a reason I need to do it this particular way but I'll spare you the details.
Here's the code I've been using, hopefully you can tell what I'm trying to do:
I hope you can help! As, I'm sure, do my neighbors, who likely can hear the swearing.
Thanks,
Derek
I've been trying for hours to figure this out (yes, including myriad Google search criteria permutations), I hope you can help!
I simply want to 'Text to Columns' with the cell which contains the data in one workbook but with the destination range in another workbook.
Although it the solution doesn't necessarily need to be in the form of VBA, I have made a rudimentary stab at it but it wants to make the destination range, the same sheet that contains the data cell.
Specifically, I need to start out in a cell inside a template workbook (A); select the cell which contains the data in another workbook (B); and have the destination be the original 'active' cell in the template workbook (B). There is a reason I need to do it this particular way but I'll spare you the details.
Here's the code I've been using, hopefully you can tell what I'm trying to do:
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
Dim rbtDest As Range
Dim rbtCell As Range
Set rbtDest = Workbooks("Book1").Worksheets("Sheet2").Range(ActiveCell.Address)
Set rbtCell = Application.InputBox(prompt:="Select Region / Branch / Team cell", Title:="Region / Branch / Team", Type:=8)
Application.CutCopyMode = False
rbtCell.TextToColumns Destination:=rbtDest, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), _
TrailingMinusNumbers:=True
rbtDest.Select
rbtDest.Value = WorksheetFunction.Trim(rbtDest)
End Sub
I hope you can help! As, I'm sure, do my neighbors, who likely can hear the swearing.
Thanks,
Derek