Using VBA to split individual characters across cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that collects the user's bank account details in 2 textboxes
(one for the account name, the other for their account number). The
preprinted forms that we use have boxes for each character of the name &
digit of the account number.

I've set up cells to match the placement of these boxes, but I'm trying to
work out how to use VBA to split the client details across these cells. I
can do this using functions, but I want to avoid having functions appearing
in what will be unlocked cells.
 
Maybe something like

=MID(the_full_name,COLUMN(A1),1)

and copy across

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
Thanks Bob,

I had this set up initially but the workbook is publicly available and I
want to avoid having functions in the cells. Is there anyway of doing this in
VBA? I've tried the following loop, but I keep getting errors:
Counter.Value = 0
Do
If Counter < 24 Then
ActiveCell.Offset(0, Counter) = Mid(txtBankName, Counter, 1)
Counter = Counter + 1
End If
Loop Until Counter = 24
 
Just change the line

Counter.Value = 0

to

Counter = 1


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top