Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error 1004 HELP

I have included a snippet. The line in question is throwing a
application or object defined error. Basically, the code should get th
last row in the worksheet and stuff a formula referenceing a cell i
that row in a different cell in another worksheet.


THNextRow = Worksheets("Total_hardware").Range("D65536").End(x lUp).Ro
+ 1

LinkText = "=" & "Total_hardware!" & THNextRow & ",3"

' the line below throws the error

Cells(1, 2).Formula = LinkTex

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Error 1004 HELP

You have left out a single quote after hardware.

also, the ,3 on the end would make the formula invalid.

TheNextRow would just be a number, so you have no column Reference

If you build a legitimate formula, it should work.

Dim rng as Range
Set rng = Worksheets("Total_hardware").Range("D65536").End(x lUp)(2)
Cells(1,2).Formula = "=" & rng.Address(External:=True)


--
Regards,
Tom Ogilvy

"woody334 " wrote in message
...
I have included a snippet. The line in question is throwing an
application or object defined error. Basically, the code should get the
last row in the worksheet and stuff a formula referenceing a cell in
that row in a different cell in another worksheet.


THNextRow = Worksheets("Total_hardware").Range("D65536").End(x lUp).Row
+ 1

LinkText = "=" & "Total_hardware!" & THNextRow & ",3"

' the line below throws the error

Cells(1, 2).Formula = LinkText


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error 1004 HELP

This line will produce a row NUMBER
THNextRow = Worksheets("Total_hardware").Range("D65536").End(x lUp).Ro

+ 1

Understood. Works great. I fill that row with new info. Each lin
contains standard info about hardware.

Cells(THNextRow, 1).Value = TB_Serial.Value
...etc
Cells(THNextRow, 18).Value = CB_Location.Value

Then I create a new sheet to detail software and hardware changes we d
to that hardware. The detail sheet should pick up the serial number an
name from the Total_Hardware sheet to avoid problems - like differin
names when we change machine names.

The suggestion to do

Dim rng As Range
Set rng
Worksheets("Total_hardware").Range("D65536").End(x lUp).Row(3)


produces a 451 Error on the 2nd line. Property Let procedure no
defined and property get procedure did not return an object.

I appreciate the help and look forward to solving this

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Error 1004 HELP

I can assure you that

Dim rng as Range
set rng = _
Worksheets("Total_hardware"). _
Range("D65536").End(xlUp).Row(3)

will not return an error if properly applied within an excel module.

Your error messages certainly sound peculiar.

--
Regards,
Tom Ogilvy




"woody334 " wrote in message
...
This line will produce a row NUMBER
THNextRow = Worksheets("Total_hardware").Range("D65536").End(x lUp).Row

+ 1

Understood. Works great. I fill that row with new info. Each line
contains standard info about hardware.

Cells(THNextRow, 1).Value = TB_Serial.Value
..etc
Cells(THNextRow, 18).Value = CB_Location.Value

Then I create a new sheet to detail software and hardware changes we do
to that hardware. The detail sheet should pick up the serial number and
name from the Total_Hardware sheet to avoid problems - like differing
names when we change machine names.

The suggestion to do

Dim rng As Range
Set rng =
Worksheets("Total_hardware").Range("D65536").End(x lUp).Row(3)


produces a 451 Error on the 2nd line. Property Let procedure not
defined and property get procedure did not return an object.

I appreciate the help and look forward to solving this.


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error 1004 HELP

Whoops my mistake.

Dim rng As Range
Set rng
Worksheets("Total_hardware").Range("D65536").End(x lUp).Row(3)

is NOT the same as

Dim rng as Range
Set rng = Worksheets("Total_hardware").Range("D65536").End(x lUp)(3

--
Message posted from http://www.ExcelForum.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error 1004 HELP

It's working !!!

Thanks for the help and please excuse my obvious oversight re : erro
451

--
Message posted from http://www.ExcelForum.com

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, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Runtime error '1004' General ODBC error star_lucas New Users to Excel 0 August 29th 05 04:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
VBA error - run-time error '1004': Romanian37 Excel Programming 3 May 21st 04 03:25 PM
Error no. 1004 Cyrus[_2_] Excel Programming 1 October 22nd 03 01:06 PM


All times are GMT +1. The time now is 02:37 AM.

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"