Data from other programs is often a delimited type as seen below in yellow cells. This comes from a text export in this instance.
Code below splits data into columns. This part works.
After the macro is run, for some reason when copying and pasting data which is in tabular format in the other program (not delimited/text), the paste is not as expected.
Thought that a setting is changed from code below. Tried to use Application.CutCopyMode but does not work.
If Excel is shut down and restarted and the source data from other program is copied and pasted, the paste into Excel works as expected.
Code below splits data into columns. This part works.
After the macro is run, for some reason when copying and pasting data which is in tabular format in the other program (not delimited/text), the paste is not as expected.
Thought that a setting is changed from code below. Tried to use Application.CutCopyMode but does not work.
If Excel is shut down and restarted and the source data from other program is copied and pasted, the paste into Excel works as expected.
VBA Code:
Sub Split_to_columns()
Dim MyRange As Range
Set MyRange = Range("A4:A100")
'Split data into columns
Application.CutCopyMode = False
MyRange.TextToColumns Destination:=MyRange.Offset(0, 1), DataType:=xlDelimited, ConsecutiveDelimiter:=True, Space:=True
Application.CutCopyMode = True
End Sub