Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro error when formatting columns
I am using the following script to format columns in two worksheets
upon opening a workbook. There will not always be data in the selected columns. My problem is the macro errors when there is no data present. How can I bypass the errors and complete the macro for the other columns that do have data? Sheets("All Other Funds Centers").Select Columns("E:E").Select Selection.TextToColumns Destination:=Range("E1"), DataType:=xlDelimited, _ TextQualifier:=xlSingleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1), TrailingMinusNumbers:=True Columns("G:G").Select Selection.TextToColumns Destination:=Range("G1"), DataType:=xlDelimited, _ TextQualifier:=xlSingleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1), TrailingMinusNumbers:=True Range("A57").Select Sheets("Spec Init - 10059 & 10080").Select Columns("E:E").Select Selection.TextToColumns Destination:=Range("E1"), DataType:=xlDelimited, _ TextQualifier:=xlSingleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1), TrailingMinusNumbers:=True Columns("G:G").Select Selection.TextToColumns Destination:=Range("G1"), DataType:=xlDelimited, _ TextQualifier:=xlSingleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1), TrailingMinusNumbers:=True Range("A57").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error message when adding 2 columns with Macro | Excel Programming | |||
Right() error changing columns in macro | Excel Programming | |||
error: Excel encountered an error and had to remove some formatting to avoid corrupting the workbook; please recheck your formatting carefully | Excel Programming | |||
Macro for formatting columns with dates, weekdays, and widths? | Excel Programming | |||
First four columns lose formatting when DAO macro is run | Excel Programming |