Because Access doesn't support text to column, I've created a linked workbook. Now what I want is that when the workbook is opened, a macro is run automatically, then the workbook is closed and saved, also automatically.
The macros I have found are:
To run the macros
To split the text
To close the workbook
Now I have two problems. One is that the macro to split the text only does one cell, I want it to do all the column if possible. The values are numbers separated by spaces. And the other problem is: how do I join them into one macro? Sorry to be so thick!
Thanks
The macros I have found are:
To run the macros
Code:
[COLOR=#333333]Private Sub Workbook_Open()[/COLOR]
[COLOR=#333333]Enter your macro here[/COLOR]
[COLOR=#333333]End Sub[/COLOR]
To split the text
Code:
Sub CopyAndSplit_IDEC1()
Dim Words As Variant
Words = Split(Sheets("Sheet2").Range("A1").Value)
With Sheets("Sheet1").Range("A1").Resize(, UBound(Words) + 1)
.Value = Words
.Value = .Value
End With
End Sub
To close the workbook
Code:
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
With ThisWorkbook
.Save
.Close
End With
Application.DisplayAlerts = True
End Sub
Now I have two problems. One is that the macro to split the text only does one cell, I want it to do all the column if possible. The values are numbers separated by spaces. And the other problem is: how do I join them into one macro? Sorry to be so thick!
Thanks