Help with Run-time error '1004': Method 'Range' of object'_Workshe

A

Ayo

I know that I did something wrong but I don't know what it is. The error
occurs on the second line of code. Any help will be appreciated.
Thanks.

Set goalWS = Worksheets("AAV Goals Update Tables")
goalWS.Range(Cells(cRow, cCol)) = c1
 
G

Gary''s Student

You don't need the Range() function. Cells() already give you the range:

Sub dural()
Dim goalWS As Worksheet
Dim c1 As Integer, cRow As Integer, cCol As Integer
cRow = 1
cCol = 1
c1 = 1
Set goalWS = Worksheets("AAV Goals Update Tables")
goalWS.Cells(cRow, cCol) = c1
End Sub

will work just fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top