Basic EXCEL VBA - input to cell help

mattcasim

New Member
Joined
Jan 25, 2005
Messages
12
I am at an intermediatte level of Visual BASIC programming and I thought it would be beneficial to learn how to adapt VB for Excel (i.e. VBA)

I am trying to write code for my spreadsheet that, on a button press, loads a userform with many input boxes/ drop downs etc. The problem I am having is getting the inputs into excel. For one input box, you have to enter age. I want to use VBA to put this in cell (say G5) so a formula in another cell can calculate age group. I.e. using an excel IF foruma which is quite straightforward.

I would appreciate any help / code that would put a string of characters / numbers from a user form text box into a cell on my excell spreadsheet

Thanks
Matt Casim
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Gettingbetter

Well-known Member
Joined
Oct 12, 2004
Messages
602
put a button on your userform

double click it and enter the below code

Range("G5") = textbox1

This will work if it is textbox1 they have filled in (Change where necessary)
 

martinee

Well-known Member
Joined
Nov 4, 2003
Messages
960
Maybe I'm misunderstanding you, because this seems somewhat straightfoward, but have you tried:
Code:
Sheets(1).Range("A1").Value = Me.TextBox1.Text

This will take the value of textbox1 and input it to cell A1 on sheet 1. HTH.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,334
Messages
5,624,089
Members
416,010
Latest member
NJT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top