![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
Can you assign a Cell value to a variable and can you make a permanant variable that changes via an inputbox??
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
|
Yes, you can do both. To assign a cell value to a variable:
Dim CellVal As Variant CellVal = [B4].Value puts the value from cell B4 into the variable named CellVal. To assign a variable from an InputBox: Dim CellVal As Variant CellVal = Application.InputBox("Enter User Name", Type:=3) where the Type:=3 indicates that you are expecting the user to enter a text string (set other type values for other data types)
__________________
Keep Excelling. Damon VBAexpert Excel Consulting (My other life: http://damonostrander.com ) |
|
|
|
|
|
#3 | |
|
New Member
Join Date: Feb 2002
Location: Turkey
Posts: 36
|
Quote:
Thanks |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|