Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Application/Object error in code

Hello Excel users and Experts,
Excel 2002

This bit of code is giving me app/obj error. If the activecell is G18
(which will change often) I want to return the values from:

Column D and the active row
Active column and row 12

Sub ReturnName_Date()
Dim j As Integer
Dim i As Integer

'Activecell is G18
'Want values from D18 and G12

j = ActiveCell.Column ' G
i = ActiveCell.Row '18

Range("F1").Value = Range("D:" & i).Value & Range(j & ":12").Value

End Sub

Thanks,
Howard


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Application/Object error in code

The Range("D:" & i).Value should be Range("D" & i).Value.

You might try

Range("F1").Value = Cells(i,"D").Value & Cells(12,"G").Value


Mark

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Application/Object error in code

Thanks, Mark. Does the job.

Thanks again
Regards,
Howard

"L. Howard Kittle" wrote in message
...
Hello Excel users and Experts,
Excel 2002

This bit of code is giving me app/obj error. If the activecell is G18
(which will change often) I want to return the values from:

Column D and the active row
Active column and row 12

Sub ReturnName_Date()
Dim j As Integer
Dim i As Integer

'Activecell is G18
'Want values from D18 and G12

j = ActiveCell.Column ' G
i = ActiveCell.Row '18

Range("F1").Value = Range("D:" & i).Value & Range(j & ":12").Value

End Sub

Thanks,
Howard



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Application/Object error in code

Sorry, I should have said

Range("F1").Value = Cells(i,4).Value & Cells(12,j).Value


Mark

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Application/Object error in code

Range("F1").Value = Range("D" & i).Value & Range(j & "12").Value


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"L. Howard Kittle" wrote in message
...
Hello Excel users and Experts,
Excel 2002

This bit of code is giving me app/obj error. If the activecell is G18
(which will change often) I want to return the values from:

Column D and the active row
Active column and row 12

Sub ReturnName_Date()
Dim j As Integer
Dim i As Integer

'Activecell is G18
'Want values from D18 and G12

j = ActiveCell.Column ' G
i = ActiveCell.Row '18

Range("F1").Value = Range("D:" & i).Value & Range(j & ":12").Value

End Sub

Thanks,
Howard






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Application/Object error in code

Thanks, Bob. Appreciate it.

Howard

"L. Howard Kittle" wrote in message
...
Hello Excel users and Experts,
Excel 2002

This bit of code is giving me app/obj error. If the activecell is G18
(which will change often) I want to return the values from:

Column D and the active row
Active column and row 12

Sub ReturnName_Date()
Dim j As Integer
Dim i As Integer

'Activecell is G18
'Want values from D18 and G12

j = ActiveCell.Column ' G
i = ActiveCell.Row '18

Range("F1").Value = Range("D:" & i).Value & Range(j & ":12").Value

End Sub

Thanks,
Howard



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
Error 1004, Application-definded or object-defined error Mirco Wilhelm[_2_] Excel Programming 9 January 7th 06 04:56 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Application-Defined or Object-Defined Error on simple code Fid[_2_] Excel Programming 1 July 21st 05 08:30 PM
Application-Defined or Object-Defined Error on simple code [email protected] Excel Programming 6 February 22nd 05 09:03 PM
Application / Object Error 1004 Garry[_7_] Excel Programming 7 October 6th 04 01:22 PM


All times are GMT +1. The time now is 05:30 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"