Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cell merge macro? 2

Status
Not open for further replies.

butchkmd

Programmer
Nov 13, 2001
83
US
Has anyone had success with a cell merge macro for the purpose of splitting one cells data to fill several cells?

ex.
cell a1=123456 {tab}
macro splits and merges cells so
a1:a6 = 1 2 3 4 5 6 respectively one digit per cell

what do you think?

I'm all ears
[bigears]
 
Instead of a macro, try this:

Cell A1: 123456
Cell B1: =MID($A1,COLUMN(B1)-1,1)

Drag B1 to the right for as many characters as you need. It will also drag down for as many values in column A as you need.

 
try this for splitting cells

Sub splitter()
tText = ActiveCell.Text
For i = 1 To Len(ActiveCell)

a = Mid(tText, i, 1)
ActiveCell.Offset(0, i - 1).Value = a
Next i
End Sub

runs on activecell - not sure how you can "split and merge" at the same time tho ???

HTH
Geoff
 
butchkmd,
Posted this answer to your thread, thread68-244170, several days ago, so that as soon as you hit enter, it spreads the input 1 character per cell, beginning with the entry cell. Skip,
metzgsk@voughtaircraft.com
 
Sir,
I most humbly appologize for missing the previous post.
It works...it works...it works! the responces above were getting me very close but yours sir works fine.

I was sure to mark the post helpful as with this one

I apreciate your time.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top