ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Textbox - code to drop into a cell (https://www.excelbanter.com/excel-programming/390125-textbox-code-drop-into-cell.html)

Abby

Textbox - code to drop into a cell
 
Hi all

This maybe a very simple code and I should know this but I am out of
practise as I haven't used code for over a year and a little out of touch.

I have designed a UserForm with lots of Textboxes and I want to drop each
textbox text into various cells on a spreadsheet (mailshot - addresses and
telephone numbers etc). I want to be able to tab through all texboxes and
when I click on OK at the end it transfers all the text into those cells.

Simple but yet hard for me to get my head round and I'm losing valuable time
- so I thought I would get on here and ask you experts.

Many thanks

Susan

Textbox - code to drop into a cell
 
abby -
here's a sample of one of my macros - will give you a place to start

'copy the data to the letters
With Sheets("bid approved")
..Range("A12").Value = Me.txtClient.Value
..Range("B8").Value = Me.txtContractor.Value
..Range("C55").Value = Me.txtClient.Value
..Range("C52").Value = Me.txtContractor.Value
..Range("B16").Value = Me.txtWinBid.Value
End With

With Sheets("Bids Listed")
..Range("A12").Value = Me.txtClient.Value
..Range("F17").Value = Me.txtWinBid.Value
..Range("F19").Value = Me.txt2nd.Value
..Range("F21").Value = Me.txt3rd.Value
..Range("F23").Value = Me.txt4th.Value
..Range("F25").Value = Me.txt5th.Value
..Range("B16").Value = Me.cboReasonWhy.Value
End With

:)
susan



On May 25, 6:07 am, Abby wrote:
Hi all

This maybe a very simple code and I should know this but I am out of
practise as I haven't used code for over a year and a little out of touch.

I have designed a UserForm with lots of Textboxes and I want to drop each
textbox text into various cells on a spreadsheet (mailshot - addresses and
telephone numbers etc). I want to be able to tab through all texboxes and
when I click on OK at the end it transfers all the text into those cells.

Simple but yet hard for me to get my head round and I'm losing valuable time
- so I thought I would get on here and ask you experts.

Many thanks





All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com