Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Combining Columns (Bracketing Text)

I have a need to combine two columns, which I can do using the features from
PUP 6. What I would like to know how to do before I combine the columns, if
any of the cells in one column, (bracket) that information before combining

--

Regards
Michael Koerner



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combining Columns (Bracketing Text)

Think you left something out of your statement

If any of the cells in one column ? ? ?,

Also, What do you mean by bracket?

Do you want to indicate missing values by putting brackets in the string

"AAA" & "()"

If you physically want to put in the brackets

Dim rng as Range, rng1 as Range
set rng = Intersect(Range("A:B"),Activesheet.UsedRange)
On Error Resume Next
set rng1 = rng.Specialcells(xlBlanks)
On error goto 0
if not rng1 is nothing then
rng1.Value = "()"
End if

--
Regards,
Tom Ogilvy



"Michael Koerner" wrote in message
...
I have a need to combine two columns, which I can do using the features
from PUP 6. What I would like to know how to do before I combine the
columns, if any of the cells in one column, (bracket) that information
before combining

--

Regards
Michael Koerner





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combining Columns (Bracketing Text)

Sub AddBrackets()
Dim rng as Range, cell as Range
set rng = Columns(2).SpecialCells(xlConstants)
for each cell in rng
if len(trim(cell)) 0 then
cell.Value = "(" & cell.Value & ")"
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Michael Koerner" wrote in message
...
Sorry about that I should have read more closely what I wrote, and should
not compose until I have had my first coffee <g

In col B, if there is data in any of the cells, then put it into
(brackets)

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Think you left something out of your statement

If any of the cells in one column ? ? ?,

Also, What do you mean by bracket?

Do you want to indicate missing values by putting brackets in the string

"AAA" & "()"

If you physically want to put in the brackets

Dim rng as Range, rng1 as Range
set rng = Intersect(Range("A:B"),Activesheet.UsedRange)
On Error Resume Next
set rng1 = rng.Specialcells(xlBlanks)
On error goto 0
if not rng1 is nothing then
rng1.Value = "()"
End if

--
Regards,
Tom Ogilvy



"Michael Koerner" wrote in message
...
I have a need to combine two columns, which I can do using the features
from PUP 6. What I would like to know how to do before I combine the
columns, if any of the cells in one column, (bracket) that information
before combining

--

Regards
Michael Koerner









  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Combining Columns (Bracketing Text)

Tom;

That worked great, thank you very much. What would I have to change to make
it work on any column I happen to be in?

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Sub AddBrackets()
Dim rng as Range, cell as Range
set rng = Columns(2).SpecialCells(xlConstants)
for each cell in rng
if len(trim(cell)) 0 then
cell.Value = "(" & cell.Value & ")"
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Michael Koerner" wrote in message
...
Sorry about that I should have read more closely what I wrote, and should
not compose until I have had my first coffee <g

In col B, if there is data in any of the cells, then put it into
(brackets)

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Think you left something out of your statement

If any of the cells in one column ? ? ?,

Also, What do you mean by bracket?

Do you want to indicate missing values by putting brackets in the string

"AAA" & "()"

If you physically want to put in the brackets

Dim rng as Range, rng1 as Range
set rng = Intersect(Range("A:B"),Activesheet.UsedRange)
On Error Resume Next
set rng1 = rng.Specialcells(xlBlanks)
On error goto 0
if not rng1 is nothing then
rng1.Value = "()"
End if

--
Regards,
Tom Ogilvy



"Michael Koerner" wrote in message
...
I have a need to combine two columns, which I can do using the features
from PUP 6. What I would like to know how to do before I combine the
columns, if any of the cells in one column, (bracket) that information
before combining

--

Regards
Michael Koerner











  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Combining Columns (Bracketing Text)

Sub AddBrackets()
Dim rng as Range, cell as Range
On error resume Next
set rng = ActiveCell.EntireColumn.SpecialCells(xlConstants)
On error goto 0
if not rng is nothing then
for each cell in rng
if len(trim(cell)) 0 then
cell.Value = "(" & cell.Value & ")"
end if
Next
end if
End Sub


--
Regards,
Tom Ogilvy


"Michael Koerner" wrote in message
...
Tom;

That worked great, thank you very much. What would I have to change to
make it work on any column I happen to be in?

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Sub AddBrackets()
Dim rng as Range, cell as Range
set rng = Columns(2).SpecialCells(xlConstants)
for each cell in rng
if len(trim(cell)) 0 then
cell.Value = "(" & cell.Value & ")"
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Michael Koerner" wrote in message
...
Sorry about that I should have read more closely what I wrote, and
should not compose until I have had my first coffee <g

In col B, if there is data in any of the cells, then put it into
(brackets)

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Think you left something out of your statement

If any of the cells in one column ? ? ?,

Also, What do you mean by bracket?

Do you want to indicate missing values by putting brackets in the
string

"AAA" & "()"

If you physically want to put in the brackets

Dim rng as Range, rng1 as Range
set rng = Intersect(Range("A:B"),Activesheet.UsedRange)
On Error Resume Next
set rng1 = rng.Specialcells(xlBlanks)
On error goto 0
if not rng1 is nothing then
rng1.Value = "()"
End if

--
Regards,
Tom Ogilvy



"Michael Koerner" wrote in message
...
I have a need to combine two columns, which I can do using the features
from PUP 6. What I would like to know how to do before I combine the
columns, if any of the cells in one column, (bracket) that information
before combining

--

Regards
Michael Koerner















  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Combining Columns (Bracketing Text)

Tom;

Thank you very much, greatly appreciated.

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Sub AddBrackets()
Dim rng as Range, cell as Range
On error resume Next
set rng = ActiveCell.EntireColumn.SpecialCells(xlConstants)
On error goto 0
if not rng is nothing then
for each cell in rng
if len(trim(cell)) 0 then
cell.Value = "(" & cell.Value & ")"
end if
Next
end if
End Sub


--
Regards,
Tom Ogilvy


"Michael Koerner" wrote in message
...
Tom;

That worked great, thank you very much. What would I have to change to
make it work on any column I happen to be in?

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Sub AddBrackets()
Dim rng as Range, cell as Range
set rng = Columns(2).SpecialCells(xlConstants)
for each cell in rng
if len(trim(cell)) 0 then
cell.Value = "(" & cell.Value & ")"
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Michael Koerner" wrote in message
...
Sorry about that I should have read more closely what I wrote, and
should not compose until I have had my first coffee <g

In col B, if there is data in any of the cells, then put it into
(brackets)

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Think you left something out of your statement

If any of the cells in one column ? ? ?,

Also, What do you mean by bracket?

Do you want to indicate missing values by putting brackets in the
string

"AAA" & "()"

If you physically want to put in the brackets

Dim rng as Range, rng1 as Range
set rng = Intersect(Range("A:B"),Activesheet.UsedRange)
On Error Resume Next
set rng1 = rng.Specialcells(xlBlanks)
On error goto 0
if not rng1 is nothing then
rng1.Value = "()"
End if

--
Regards,
Tom Ogilvy



"Michael Koerner" wrote in message
...
I have a need to combine two columns, which I can do using the
features from PUP 6. What I would like to know how to do before I
combine the columns, if any of the cells in one column, (bracket) that
information before combining

--

Regards
Michael Koerner















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
How do I automate bracketing of text in an Excel cell? Kevin Excel Discussion (Misc queries) 2 March 8th 10 09:29 AM
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
Double quotes bracketing text strings that include commas ExcelStudent Excel Discussion (Misc queries) 1 August 2nd 07 12:48 PM
combining two text columns into one ferde Excel Discussion (Misc queries) 4 May 10th 07 11:42 PM
How Do I use COUNTIF Combining the Text from 2 Columns Kevin Excel Worksheet Functions 7 March 19th 06 05:36 PM


All times are GMT +1. The time now is 11:10 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"