Application/Object error in code

L

L. Howard Kittle

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
 
M

mark.driscol

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
 
M

mark.driscol

Sorry, I should have said

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


Mark
 
B

Bob Phillips

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


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

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