Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Help with Run-time error '1004': Method 'Range' of object'_Workshe

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Help with Run-time error '1004': Method 'Range' of object'_Workshe

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.
--
Gary''s Student - gsnu200902


"Ayo" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': Method 'Range' of object '_Worksheet'failed... again! [email protected] Excel Programming 4 March 6th 09 06:47 AM
Run-time error '1004': Method 'Range' of object '_Worksheet' failed [email protected] Excel Programming 2 March 6th 09 03:23 AM
Run-time error '1004': Insert method of Range class failed jerryb123 Excel Programming 2 September 29th 08 06:02 PM
Run-time error '1004' PasteSpecial Method of Range Class Failed Kevin G[_2_] Excel Programming 1 February 3rd 04 05:01 AM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"