VB variables excel

Posted on 2006-05-05
Last Modified: 2010-05-01
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.
Question by:Justin Malone
    LVL 4

    Author Comment

    by:Justin Malone
    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?
    LVL 44

    Accepted Solution

    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
    LVL 4

    Author Comment

    by:Justin Malone
    ill try it out tomarow but it looks like exactly what im looking for

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now