View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel Nigel is offline
external usenet poster
 
Posts: 923
Default Merge to Columns with Unknown length

Puts the merged cells B and C into cell A for only rows up to the last
column B entry.....

with activesheet
xlastrow = .cells(rows.count,2).end(xlup).row
for x = 1 to xlastrow
.cells(x,1) = .cells(x,2) & " " & .cells(x,3) & " "
next x
end with

--
Cheers
Nigel



"Steve M" wrote in
message ...

Hi - I have a spreadsheet with 2 columns

House Name
House Number

I want to merge these to columns and I have used the following

=B2&" "&C2&" "

This works fine except I want to run a macro that automatically merges
these 2 columns from a helper column I created - the only problem being
I do not know how many House names or numbers need merging per
spreadsheet so my macro automatical self calculates 500 rows but the
database these spreadsheets can uploaded in to keeps reading the blank
spaces left behind in the empty rows and failing

Anyone know how to let the macro know when to stop at the last row of
data please

Any help appreciated


--
Steve M
------------------------------------------------------------------------
Steve M's Profile:

http://www.excelforum.com/member.php...o&userid=32520
View this thread: http://www.excelforum.com/showthread...hreadid=523495