Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro delimiting text if column has value

This is my macro, it goes column by column A - AZ delimiting text. The
problem I have is that I get an error message on the first column which is
empty.

After column A, is there a way to say if B1 is null, end macro before moving
on to delimit Text in Column B?

I want to make this macro available to other users but the error message is
a problem.

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("B:B").Select
Selection.TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True

--
Sincerely,
Beverly76
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro delimiting text if column has value

Your code does data|text to columns|delimited by tab on column A.

Doesn't that mean that all the stuff in column A now is parsed into B:xxx based
on tab characters?

And the stuff in column B won't have any tab characters there at all.

Is that what you're doing or am I missing something?



Beverly76 wrote:

This is my macro, it goes column by column A - AZ delimiting text. The
problem I have is that I get an error message on the first column which is
empty.

After column A, is there a way to say if B1 is null, end macro before moving
on to delimit Text in Column B?

I want to make this macro available to other users but the error message is
a problem.

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("B:B").Select
Selection.TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True

--
Sincerely,
Beverly76


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro delimiting text if column has value

It is more of a procedural step to make sure all the text is where it is
supposed to be, where it appears to be.

It is probably redundant. But what I really want at this point is the code
to interrupt the macro if a cell is blank.
--
Sincerely,
Beverly76


"Dave Peterson" wrote:

Your code does data|text to columns|delimited by tab on column A.

Doesn't that mean that all the stuff in column A now is parsed into B:xxx based
on tab characters?

And the stuff in column B won't have any tab characters there at all.

Is that what you're doing or am I missing something?



Beverly76 wrote:

This is my macro, it goes column by column A - AZ delimiting text. The
problem I have is that I get an error message on the first column which is
empty.

After column A, is there a way to say if B1 is null, end macro before moving
on to delimit Text in Column B?

I want to make this macro available to other users but the error message is
a problem.

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("B:B").Select
Selection.TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True

--
Sincerely,
Beverly76


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro delimiting text if column has value



Option Explicit
Sub testme01()

Dim iCol As Long

With ActiveSheet

iCol = 1
Do
If iCol .Columns.Count Then
Exit Do
End If
If IsEmpty(.Cells(1, iCol).Value) Then
Exit Do
End If

With .Columns(iCol)
.TextToColumns Destination:=.Cells(1), _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, _
Tab:=True, Semicolon:=False, Comma:=False, _
Space:=False, Other:=False, _
FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True
End With
iCol = iCol + 1
Loop
End With

End Sub






Beverly76 wrote:

It is more of a procedural step to make sure all the text is where it is
supposed to be, where it appears to be.

It is probably redundant. But what I really want at this point is the code
to interrupt the macro if a cell is blank.
--
Sincerely,
Beverly76

"Dave Peterson" wrote:

Your code does data|text to columns|delimited by tab on column A.

Doesn't that mean that all the stuff in column A now is parsed into B:xxx based
on tab characters?

And the stuff in column B won't have any tab characters there at all.

Is that what you're doing or am I missing something?



Beverly76 wrote:

This is my macro, it goes column by column A - AZ delimiting text. The
problem I have is that I get an error message on the first column which is
empty.

After column A, is there a way to say if B1 is null, end macro before moving
on to delimit Text in Column B?

I want to make this macro available to other users but the error message is
a problem.

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns("B:B").Select
Selection.TextToColumns Destination:=Range("B1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True

--
Sincerely,
Beverly76


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/paste from other application without delimiting it? Jennifer Excel Discussion (Misc queries) 2 December 10th 08 11:49 PM
tab delimiting numbers EngelseBoer Excel Discussion (Misc queries) 3 September 8th 08 02:53 AM
Delimiting and Formatting Delimiting and Formatting Excel Discussion (Misc queries) 2 May 9th 07 07:26 PM
delimiting w/multiple delimiters? NTaylor Excel Discussion (Misc queries) 0 January 11th 06 04:22 PM
Pasting from clipboard-how to control text-to-columns delimiting stebro Excel Discussion (Misc queries) 1 June 15th 05 05:31 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"