Why does this not work?

Xineq

New Member
Joined
Aug 29, 2014
Messages
34
Hey MrExcel

i dont understand why this:

Code:
StrAddress = Worksheets(Counting).Cells("R2")

Dont work. I want my StrAddress to always to be referring to the Cell R2 in my Counting Sheet
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Comfy

Well-known Member
Joined
Dec 21, 2009
Messages
3,377
Code:
Counting = "Sheet1"
Set StrAddress = Worksheets(Counting).Range("R2")
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Should it be

Code:
StrAddress = Worksheets("Counting").Range("R2").Value
 

Watch MrExcel Video

Forum statistics

Threads
1,109,004
Messages
5,526,228
Members
409,689
Latest member
martin_br

This Week's Hot Topics

Top