Excel function for tables

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
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.
 
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....
 
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?
 
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!
 
Back
Top