Ashfranc0223
New Member
- Joined
- Jan 17, 2019
- Messages
- 1
When I execute the VBA code that is given below, I get an error "Compiler Error: Invalid Qualifier" and the name of subprocedure gets highlighted. Why does this happen? I have attached a copy of the code below:
Code:
Option Explicit
Sub TestA()
Dim numberrange As Range
Dim c As Range, maxv As Long, maxa As String
Set numberrange = Application.InputBox("Select a range to find max value", "Max Value", , , , , , 8)
maxv = numberrange.Cells(1, 1).Value
maxa = numberrange.Cells(1, 1).Address
For Each c In numberrange.Value
If c.Value > maxv.Value Then
c.Value = maxv.Value
c.Address = maxa.Address
End If
Next c
MsgBox ("max:" & maxv)
End Sub
Last edited by a moderator: