fatman0013
New Member
- Joined
- Sep 20, 2010
- Messages
- 13
Well i got this far.... but it looks like i have alot to learn.
i have 20 worksheets in a workbook and i ned to insert a new column to the right of column A, and then pars the data in column A using a fixed with.
here is what i have :
Sub insert 3()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
Columns("B:C").Select
Selection.insert Shift = lToRight
Next ws
End Sub
'all this is doing is adding about 50 columns to the active worksheet.
'Then to Pars the data in colum A i was tring this:
Sub pars()
' pars Macro
Dim ws As Worksheet
For Each ws In Worksheets
'make sure that cell B1 is not empty
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(12, 1)), TrailingMinusNumbers:=True
Next myWorksheet
End Sub
This one worked it parsed my data from column A with the fix-with; but again it only did it in the active worksheet and not for all of the worksheet in the workbook.
Any help would be great!!
i have 20 worksheets in a workbook and i ned to insert a new column to the right of column A, and then pars the data in column A using a fixed with.
here is what i have :
Sub insert 3()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
Columns("B:C").Select
Selection.insert Shift = lToRight
Next ws
End Sub
'all this is doing is adding about 50 columns to the active worksheet.
'Then to Pars the data in colum A i was tring this:
Sub pars()
' pars Macro
Dim ws As Worksheet
For Each ws In Worksheets
'make sure that cell B1 is not empty
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(12, 1)), TrailingMinusNumbers:=True
Next myWorksheet
End Sub
This one worked it parsed my data from column A with the fix-with; but again it only did it in the active worksheet and not for all of the worksheet in the workbook.
Any help would be great!!