Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the a string val from a Excel Range ?? Help

Status
Not open for further replies.

WMitchellCPQ

Programmer
Sep 28, 2001
54
US
Hi Im new to both VB and VBA im having problems with the following.

str = Range("SheetName!RangeName").Cells(2, i).Value

It seems as if the types are no the same. How can i make the value from range a string ?

Thanks in advance
W
 
Hi, W,

Convert to string CStr function
Code:
str = CStr(Range("SheetName!RangeName").Cells(2, i).Value)
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
or you could just use .TEXT ;-)

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top