[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

VB variables excel

how do i define a var as a cell allreddy in the worksheet

i am createing a simple macro program that allows you to simply put strings togeather to form a template. now im simply createing a reset button that will restore all options to default settings i have combo boxes that the value needs to change back to the first value. i am looking for a way to either define  something like cell A1 as a varable or code that would change the value of cbo1 to the first value.
0
Justin Malone
Asked:
Justin Malone
  • 2
1 Solution
 
Justin MaloneAuthor Commented:
even though i have figured out anohther way to do this i would still like to find out how to call the information in a cell sutch as

txtName = $A1

any ideas?
0
 
bruintjeCommented:
Hi squallkill99,

you can try
txtName = ThisWorkbook.Sheets(1).Range("$A1").value

where Sheets(1) is the number of your sheet where A1 is on you can also you Sheets("MyName") where MyName is the name of your sheet

hope this helps a bit
bruintje
0
 
Justin MaloneAuthor Commented:
ill try it out tomarow but it looks like exactly what im looking for
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now