![]() |
Using VBA to split individual characters across cells
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. |
Using VBA to split individual characters across 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) "BOBODD" wrote in message ... 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. |
Using VBA to split individual characters across cells
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 "Bob Phillips" wrote: 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) "BOBODD" wrote in message ... 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. |
Using VBA to split individual characters across cells
Just change the line
Counter.Value = 0 to Counter = 1 -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "BOBODD" wrote in message ... 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 "Bob Phillips" wrote: 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) "BOBODD" wrote in message ... 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. |
All times are GMT +1. The time now is 04:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com