how to add cell text in a string

how can i grab text from a cell and insert into a string? having a hard time:

Dim Cust As String
Cust = Sheets("Results").Cells(R2)

Open in new window


Thanks.
eastsidemarketAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

[ fanpages ]IT Services ConsultantCommented:
:)

Almost there.

Dim Cust As String

Cust = Worksheets("Results").Range("R2")
or
Cust = Worksheets("Results").[R2]
or
Cust = [Results].[R2]
or
Cust = Worksheets("Results").Cells(2, "R")
or
Cust = Worksheets("Results").Cells(2, 18)

...or...

Combinations thereof.


BFN,

fp.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eastsidemarketAuthor Commented:
perfect, thanks!
0
[ fanpages ]IT Services ConsultantCommented:
You're very welcome.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

andrewssd3Commented:
fanpages has as always given an amazingly comprehensive answer. I think it's just worth adding (not for points) that all those answers use the fact that .Value is the default property of the Range object. I think its always best to specify it, e.g.
Cust = Worksheets("Results").Range("R2").Value

Open in new window

, etc. This makes it clear you're looking at the value of the range not the range itself and avoids ambiguity - and you might want to be using the Text or Value2 properties instead in some circumstances.
0
eastsidemarketAuthor Commented:
nice, thanks!
0
Martin LissOlder than dirtCommented:
Nice work FP.
0
[ fanpages ]IT Services ConsultantCommented:
Thanks andrewssd3 (& thank you to you, too, Marty).

Yes, should you wish to investigate the useful (or not) nature of the .Value2 &/or .Text properties, may I suggest looking at this blog entry at Dick Kusleika's "A Daily Dose of Excel":

"A Case for Value as a Default Property"
[ http://dailydoseofexcel.com/archives/2011/12/02/a-case-for-value-as-a-default-property/ ]

(You will see I comment beneath the main article text)

The article draws upon an article written by Charles Williams in his "Excel and UDF Performance Stuff" blog:

"TEXT vs VALUE vs VALUE2 – Slow TEXT and how to avoid it"
[ http://fastexcel.wordpress.com/2011/11/30/text-vs-value-vs-value2-slow-text-and-how-to-avoid-it/ ]
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.