NONE

  • Thread starter Thread starter bw
  • Start date Start date
B

bw

Prompt = "Select a Flight"
Set FltNum = Application.InputBox(Prompt, "Airline/Flight Number", , 155, 150, Type:=8)

The code above works like I was expecting.
However, when I use the scrolll bar before selecting a cell, the On Error branch occurs,
and FltNum is empty. Can anyone explain why I'm having this problem?

Thanks,
Bernie
 
Hi Bernie
works fine for me (even using the scroll bar prior to selecting a cell)
 
Thanks for the reply Frank.

I need some support, as this thing is driving me crazy.

I copied a new procedure off a web page and put it into a new workbook, and it works
fine...and gives me lots of information in the process.

But as soon as I copy this same procedure into the workbook I want it in...it works as
long as I don't touch the scroll bar.

So what could be wrong with the workbook I want it in?

Any suggestions as to what may be causing this would be helpful.

The "new" procedure I'm using is shown below.

Thanks for your help,
Bernie


Sub HowToGetUserRange()
Dim UserRange As Range, sDlgTitle As String

Prompt = "Select a range"
sDlgTitle = "HowToGetUserRange"

On Error Resume Next
Set UserRange = Application.InputBox("Select range", sDlgTitle, ActiveCell.Address,
Type:=8)
If UserRange Is Nothing Then Exit Sub

With UserRange
MsgBox "Choice was: " & .Address & ", sh=" & .Parent.Name & ", wb=" &
Parent.Parent.Name, vbInformation, sDlgTitle
.Parent.Parent.Activate 'change to selected workbook
.Parent.Activate 'change to selected sheet
.Activate 'change to selected range
MsgBox "Chosen range now activated", vbInformation, sDlgTitle
End With

End Sub
 
I have made SOME progress. I deleted "Sheet1" of my workbook, which has reference
(VLOOKUP) to "Sheet2".

When I deleted Sheet1, the procedure works as it should. So it seems now that the
problem has something to do with reference to Sheet2 by Sheet1...but Why?

By the way, prior to deleting Sheet1, I also deleted all other macros to see if they were
interfering in some way, but I still had the problem.

Frustrated...
Bernie
 

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

Back
Top