Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Then Trouble

Status
Not open for further replies.

Harlequin007

Technical User
Feb 9, 2004
249
GB
Hi guys.

Having a bit of a minor headache with an If Then Statement.

Goes like this:

Dim Response As Integer
MsgBox ("Have You Selected a Cell in Column A and below Row 77"), vbYesNo, ("DVW Workbook")
If Response = 6 Then
ActiveCell.Range("A1:L3").Select

(Lots more code here . . .)

ActiveCell.Offset(2, 0).Range("A1").Select
Else
End If

What am I missing . . . ?

But it doesn't seem to matter whether I press Yes or No


-----------------
Cogito Ergo Sum
-----------------
 
You need to use InputBox to get user response.
 
Hi,

You need to assign a value to Response...
Code:
    Dim Response As Integer
    Response = MsgBox("Have You Selected a Cell in Column A and below Row 77", vbYesNo)
    If Response = vbYes Then
    ActiveCell.Range("A1:L3").Select
    ActiveCell.Offset(2, 0).Range("A1").Select
    Else
    End If


Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Cheers Skip.

I think I missed that.


-----------------
Cogito Ergo Sum
-----------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top