Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

I need to merge columns, regardless of how many rows there are. I got some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1 stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with a Macro


Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I got

some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1 stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob



  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

Tom,
I appreciate you quick reply.

I ran the macro you suggested, but it does not seem to do what I was hoping.
Maybe I wasn't very clear. Am I missing something?

If I need to explain it again in different terms, let me know.

A beginner...
Rob

"Tom Ogilvy" wrote:


Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I got

some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1 stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with a Macro

You said you had this

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

As I understood you you wanted to end up with this

|Company&Last|Name|Suffix|stuff1|stuff2|stuff3


the macro was off a little. Try this:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:F").Delete

End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I got

some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1

stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob





  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

Tom, Maybe I didn't say it right. I have...

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

and I would like...

Company&Last, First Suffix|stuff1|stuff2|stuff3



"Tom Ogilvy" wrote:

You said you had this

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

As I understood you you wanted to end up with this

|Company&Last|Name|Suffix|stuff1|stuff2|stuff3


the macro was off a little. Try this:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:F").Delete

End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I got

some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1

stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with a Macro

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"", ""&F1&"" ""&G1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:G").Delete

End Sub


What you said originally
A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

What you say now
Company&Last, First Suffix|stuff1|stuff2|stuff3

Included name and left out First - so yes, I would say maybe you didn't say
it right, particularly when you add in word wrap and spacing.

Hopefully this will do it for you.
the macro produced this for me:

CompanyLast, First Suffix|stuff1|stuff2|Stuff3

--
Regards,
Tom Ogilvy

"Rob" wrote in message
...
Tom, Maybe I didn't say it right. I have...

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

and I would like...

Company&Last, First Suffix|stuff1|stuff2|stuff3



"Tom Ogilvy" wrote:

You said you had this

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

As I understood you you wanted to end up with this

|Company&Last|Name|Suffix|stuff1|stuff2|stuff3


the macro was off a little. Try this:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:F").Delete

End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I

got
some
great help last week, now I need to take it a step further...

A B C D E F

G
H I
Name Company Prefix Last First Suffix stuff1

stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with a Macro

Slight variation

Sub CCC()
Dim rng As Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"",""&B1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:F").Delete
End Sub


You are deleting First as well.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
Tom,
I appreciate you quick reply.

I ran the macro you suggested, but it does not seem to do what I was

hoping.
Maybe I wasn't very clear. Am I missing something?

If I need to explain it again in different terms, let me know.

A beginner...
Rob

"Tom Ogilvy" wrote:


Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I got

some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1

stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob






  #8   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

Tom,
I apologize that I wrote the wrong thing at first. Thank you for your
perseverance even though!!!

Something still isn't right. It seems to be only merging data if all cells
have data. First instance, the first tow, with the headings of COMPANY,
LAST, FIRST etc all had data and your macro worked perfectly.

The problem seems to be that only half of the rows below that have a company
and only half have a last, first, and suffix.

Make sense? Again, maybe I screwed up and should have said this in the
first place. I didn't realize it matters if there was data in the columns.

Rob

"Tom Ogilvy" wrote:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"", ""&F1&"" ""&G1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:G").Delete

End Sub


What you said originally
A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

What you say now
Company&Last, First Suffix|stuff1|stuff2|stuff3

Included name and left out First - so yes, I would say maybe you didn't say
it right, particularly when you add in word wrap and spacing.

Hopefully this will do it for you.
the macro produced this for me:

CompanyLast, First Suffix|stuff1|stuff2|Stuff3

--
Regards,
Tom Ogilvy

"Rob" wrote in message
...
Tom, Maybe I didn't say it right. I have...

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

and I would like...

Company&Last, First Suffix|stuff1|stuff2|stuff3



"Tom Ogilvy" wrote:

You said you had this

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

As I understood you you wanted to end up with this

|Company&Last|Name|Suffix|stuff1|stuff2|stuff3


the macro was off a little. Try this:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:F").Delete

End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I

got
some
great help last week, now I need to take it a step further...

A B C D E F

G
H I
Name Company Prefix Last First Suffix stuff1
stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob








  #9   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

Bob,
Thank for your help...

I need a little more help!!!

Take a look at this again... Here is what I need...

From...
Name | Company | Prefix | Last | First | Suffix | Stuff1 | Stuff2 | stuff3
To...
CompanyLast, First Suffix | Stuff1 |Stuff2 | Stuff3

Also note that not all rows have data in each of these columns.

yes, I am deleting Name and Prefix

"Bob Phillips" wrote:

Slight variation

Sub CCC()
Dim rng As Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"",""&B1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:F").Delete
End Sub


You are deleting First as well.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
Tom,
I appreciate you quick reply.

I ran the macro you suggested, but it does not seem to do what I was

hoping.
Maybe I wasn't very clear. Am I missing something?

If I need to explain it again in different terms, let me know.

A beginner...
Rob

"Tom Ogilvy" wrote:


Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I got
some
great help last week, now I need to take it a step further...

A B C D E F G
H I
Name Company Prefix Last First Suffix stuff1

stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with a Macro

Sub CCC()
Columns(1).Insert
Set rng = Intersect(Activesheet.UsedRange, _
Activesheet.Columns(3)).Cells
rng.Offset(0, -2).Formula = "=C1&E1&"", ""&F1&"" ""&G1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:G").Delete
End Sub

--
Regards,
Tom Ogilvy



"Rob" wrote in message
...
Tom,
I apologize that I wrote the wrong thing at first. Thank you for your
perseverance even though!!!

Something still isn't right. It seems to be only merging data if all

cells
have data. First instance, the first tow, with the headings of COMPANY,
LAST, FIRST etc all had data and your macro worked perfectly.

The problem seems to be that only half of the rows below that have a

company
and only half have a last, first, and suffix.

Make sense? Again, maybe I screwed up and should have said this in the
first place. I didn't realize it matters if there was data in the

columns.

Rob

"Tom Ogilvy" wrote:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"", ""&F1&"" ""&G1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:G").Delete

End Sub


What you said originally
A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

What you say now
Company&Last, First Suffix|stuff1|stuff2|stuff3

Included name and left out First - so yes, I would say maybe you didn't

say
it right, particularly when you add in word wrap and spacing.

Hopefully this will do it for you.
the macro produced this for me:

CompanyLast, First Suffix|stuff1|stuff2|Stuff3

--
Regards,
Tom Ogilvy

"Rob" wrote in message
...
Tom, Maybe I didn't say it right. I have...

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

and I would like...

Company&Last, First Suffix|stuff1|stuff2|stuff3



"Tom Ogilvy" wrote:

You said you had this

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

As I understood you you wanted to end up with this

|Company&Last|Name|Suffix|stuff1|stuff2|stuff3


the macro was off a little. Try this:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:F").Delete

End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are.

I
got
some
great help last week, now I need to take it a step further...

A B C D E F

G
H I
Name Company Prefix Last First Suffix stuff1
stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob












  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with a Macro

Rob,

Did Tom's suggestion fix it, or is it still outstanding?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
Bob,
Thank for your help...

I need a little more help!!!

Take a look at this again... Here is what I need...

From...
Name | Company | Prefix | Last | First | Suffix | Stuff1 | Stuff2 | stuff3
To...
CompanyLast, First Suffix | Stuff1 |Stuff2 | Stuff3

Also note that not all rows have data in each of these columns.

yes, I am deleting Name and Prefix

"Bob Phillips" wrote:

Slight variation

Sub CCC()
Dim rng As Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"",""&B1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:F").Delete
End Sub


You are deleting First as well.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
Tom,
I appreciate you quick reply.

I ran the macro you suggested, but it does not seem to do what I was

hoping.
Maybe I wasn't very clear. Am I missing something?

If I need to explain it again in different terms, let me know.

A beginner...
Rob

"Tom Ogilvy" wrote:


Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I

got
some
great help last week, now I need to take it a step further...

A B C D E F

G
H I
Name Company Prefix Last First Suffix stuff1

stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob








  #12   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

Perfect!!! Thank you Tom!!!

"Tom Ogilvy" wrote:

Sub CCC()
Columns(1).Insert
Set rng = Intersect(Activesheet.UsedRange, _
Activesheet.Columns(3)).Cells
rng.Offset(0, -2).Formula = "=C1&E1&"", ""&F1&"" ""&G1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:G").Delete
End Sub

--
Regards,
Tom Ogilvy



"Rob" wrote in message
...
Tom,
I apologize that I wrote the wrong thing at first. Thank you for your
perseverance even though!!!

Something still isn't right. It seems to be only merging data if all

cells
have data. First instance, the first tow, with the headings of COMPANY,
LAST, FIRST etc all had data and your macro worked perfectly.

The problem seems to be that only half of the rows below that have a

company
and only half have a last, first, and suffix.

Make sense? Again, maybe I screwed up and should have said this in the
first place. I didn't realize it matters if there was data in the

columns.

Rob

"Tom Ogilvy" wrote:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"", ""&F1&"" ""&G1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:G").Delete

End Sub


What you said originally
A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

What you say now
Company&Last, First Suffix|stuff1|stuff2|stuff3

Included name and left out First - so yes, I would say maybe you didn't

say
it right, particularly when you add in word wrap and spacing.

Hopefully this will do it for you.
the macro produced this for me:

CompanyLast, First Suffix|stuff1|stuff2|Stuff3

--
Regards,
Tom Ogilvy

"Rob" wrote in message
...
Tom, Maybe I didn't say it right. I have...

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

and I would like...

Company&Last, First Suffix|stuff1|stuff2|stuff3



"Tom Ogilvy" wrote:

You said you had this

Name|Company|Prefix|Last|First|Suffix|stuff1|stuff 2|stuff3

As I understood you you wanted to end up with this

|Company&Last|Name|Suffix|stuff1|stuff2|stuff3


the macro was off a little. Try this:

Sub CCC()
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:F").Delete

End Sub

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...

Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are.

I
got
some
great help last week, now I need to take it a step further...

A B C D E F
G
H I
Name Company Prefix Last First Suffix stuff1
stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob











  #13   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Help with a Macro

Yes, Tom fixed my problem. Thanks!

"Bob Phillips" wrote:

Rob,

Did Tom's suggestion fix it, or is it still outstanding?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
Bob,
Thank for your help...

I need a little more help!!!

Take a look at this again... Here is what I need...

From...
Name | Company | Prefix | Last | First | Suffix | Stuff1 | Stuff2 | stuff3
To...
CompanyLast, First Suffix | Stuff1 |Stuff2 | Stuff3

Also note that not all rows have data in each of these columns.

yes, I am deleting Name and Prefix

"Bob Phillips" wrote:

Slight variation

Sub CCC()
Dim rng As Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1&"",""&B1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("B:F").Delete
End Sub


You are deleting First as well.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Rob" wrote in message
...
Tom,
I appreciate you quick reply.

I ran the macro you suggested, but it does not seem to do what I was
hoping.
Maybe I wasn't very clear. Am I missing something?

If I need to explain it again in different terms, let me know.

A beginner...
Rob

"Tom Ogilvy" wrote:


Sub CCC()
Dim rng as Range
Columns(1).Insert
Set rng = Range("C1", Cells(Rows.Count, 3).End(xlUp))
rng.Offset(0, -2).Formula = "=C1&E1"
rng.Offset(0, -2).Formula = rng.Offset(0, -2).Value
Range("C:D,F:F").Delete
End Sub

--
Regards,
Tom Ogilvy





"Rob" wrote in message
...
I need to merge columns, regardless of how many rows there are. I

got
some
great help last week, now I need to take it a step further...

A B C D E F

G
H I
Name Company Prefix Last First Suffix stuff1
stuff2
stuff3

into...

A B C D
CompanyLast, Name Suffix stuff1 Stuff2 stuff3

(I do realize I am deleting the Prefix in C)

Any help would be deeply appreciated!!!
Rob









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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 05:23 AM.

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"