Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Macro to combine cells

You can modify the macro he

http://www.mcgimpsey.com/excel/mergedata.html

change

vTxtArr(i, 1) = vTxtArr(i, 1) & sDelim & vTxtArr(i, j)

to

vTxtArr(i, 1) = Left(vTxtArr(i, 1) & sDelim & vTxtArr(i, j), 1000)


In article ,
Bob wrote:

I have a column with about 6,000 rows.
I need a macro that will combine cells in the column with a pipe(|) between
each.
The key is that each row should be no more than 1,000 characters.

  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Macro to combine cells

how do I make the procedure work as a macro?

"JE McGimpsey" wrote:

You can modify the macro he

http://www.mcgimpsey.com/excel/mergedata.html

change

vTxtArr(i, 1) = vTxtArr(i, 1) & sDelim & vTxtArr(i, j)

to

vTxtArr(i, 1) = Left(vTxtArr(i, 1) & sDelim & vTxtArr(i, j), 1000)


In article ,
Bob wrote:

I have a column with about 6,000 rows.
I need a macro that will combine cells in the column with a pipe(|) between
each.
The key is that each row should be no more than 1,000 characters.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Macro to combine cells

Check out David McRitchie's "Getting Started with Macros":

http://www.mvps.org/dmcritchie/excel/getstarted.htm


In article ,
Bob wrote:

how do I make the procedure work as a macro?

  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Macro to combine cells

I got this to run,however, I get a "Object variable or with block variable
not set" error message at the line vTxtArr = rRng.Value

"JE McGimpsey" wrote:

Check out David McRitchie's "Getting Started with Macros":

http://www.mvps.org/dmcritchie/excel/getstarted.htm


In article ,
Bob wrote:

how do I make the procedure work as a macro?


  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Macro to combine cells

I got this to run without error messages, however,I don't see where the
combined cells are (I did switch vTxtArr(i, 1) = vTxtArr(i, 1) & sDelim &
vTxtArr(i, j)as suggested) .

"JE McGimpsey" wrote:

Check out David McRitchie's "Getting Started with Macros":

http://www.mvps.org/dmcritchie/excel/getstarted.htm


In article ,
Bob wrote:

how do I make the procedure work as a macro?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Macro to combine cells

The text from all columns is merged into the first column.

In article ,
Bob wrote:

I got this to run without error messages, however,I don't see where the
combined cells are (I did switch vTxtArr(i, 1) = vTxtArr(i, 1) & sDelim &
vTxtArr(i, j)as suggested) .

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 to combine 'like' rows [email protected] Excel Discussion (Misc queries) 2 October 3rd 08 06:46 AM
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
Combine 2 macro bioyyy Excel Discussion (Misc queries) 3 October 17th 05 07:58 PM
Combine two spreadsheets using Macro jlogsdon Excel Worksheet Functions 0 May 23rd 05 11:14 PM
Combine Files macro Tom Ogilvy Excel Programming 0 September 17th 03 12:31 PM


All times are GMT +1. The time now is 08:30 AM.

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

About Us

"It's about Microsoft Excel"