Excel function for tables

J

Jonathan Rynd

This it the error message that I get:
"Run-time error '438'
Object does not support this property or method"
Then you are given the options to "End" "Debug" or "Help"

Argh, still can't get it to work

I'll get back to you later.
 
J

Jonathan Rynd

1. put the following in view code of Mileage Chart:

-------------------------------------------------------------
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Worksheet.Name = "Mileage Chart" Then
Dim c As Integer
Dim r As Long
If Target.Count > 1 Then Exit Sub
c = Target.Column
r = Target.Row
If c < 2 Or c > 13 Or r < 3 Or r > 14 Then Exit Sub
Dim s As Worksheet
Set s = ActiveWorkbook.Worksheets("Travel Form")
With s

.Cells(getar(), 6) = Target.Value
.Cells(getar(), 3) = Cells(2, c).Value
.Cells(getar(), 2) = Cells(r, 1).Value
End With
End If
End Sub
-----------------------------------------------------


2. Put the following in View Code of Travel Form:
-----------------------------------------------------
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
setar Target.Row
End Sub
-----------------------------------------------------

3. Then don't close the window but choose Insert/Module. Put the
following in there:

Option Explicit

Public ar As Integer

Public Sub setar(i As Integer)
ar = i
End Sub

Public Function getar() As Integer
getar = ar
End Function
 
J

Jonathan Rynd

I am still getting the same error. Just to make sure that I have
entered everything correctly, I am copying what I have entered into
the code on the mileage chart and on the travel form.

Please see my newer post that was posted at the same time as your post.
 
G

Guest

OK - I have entered those three codes, and I am now getting a ""Run-time error 1004" application-defined or object-defined error" And I get the option to End Debug or Help....
 
J

Jonathan Rynd

OK - I have entered those three codes, and I am now getting a
""Run-time error 1004" application-defined or object-defined error"
And I get the option to End Debug or Help....

I've tested those codes and they work for me. When you click on Debug,
which line is highlighted?
 
G

Guest

It is working.....no more errors, I don't know what was going on when I posted the previous reply

Thank you, thank you, thank you for all of your help! You are Great!
 

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