Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-19-2017, 07:32 AM
FUGMAN FUGMAN is offline Message Box to advise corrective action required Windows 10 Message Box to advise corrective action required Office 2016
Banned
Message Box to advise corrective action required
 
Join Date: Feb 2017
Posts: 55
FUGMAN is on a distinguished road
Default Message Box to advise corrective action required


If a Command Button is activated to run a macro and if any of the rows 1 through 7 are active, do not run macro…..but show message box advising that this is the case. Message Box to have a button having caption “ok” which will return control back to user. If neither of the rows 1 through 7 are the Active Row, run the macro.
Reply With Quote
  #2  
Old 02-19-2017, 12:28 PM
jeffreybrown jeffreybrown is offline Message Box to advise corrective action required Windows Vista Message Box to advise corrective action required Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Give this a try...

Code:
Sub Button1_Click()
    If activecell.Row > 7 Then
        Call OtherMacro
    ElseIf activecell.Row < 8 Then
        MsgBox "Marcro cannot be run on a row between 1 and 7"
        Exit Sub
    End If
End Sub
Reply With Quote
  #3  
Old 02-19-2017, 01:50 PM
FUGMAN FUGMAN is offline Message Box to advise corrective action required Windows 10 Message Box to advise corrective action required Office 2016
Banned
Message Box to advise corrective action required
 
Join Date: Feb 2017
Posts: 55
FUGMAN is on a distinguished road
Default

jeffreybrown

Works like a charm. Thank you very much.
Would you have time to look at another "if then else" issue?

If "A37" has more than one letter then "C15" = " A37" and "C16"="A38" and Otherwise "C15" =" " and "C16" = "A37"

Thanks again for your solution to my inquiry.
Reply With Quote
  #4  
Old 02-19-2017, 02:02 PM
jeffreybrown jeffreybrown is offline Message Box to advise corrective action required Windows Vista Message Box to advise corrective action required Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Could be as simple as...
Code:
Sub Look_At_A37()
    If Len(Range("A37")) > 1 Then
        Range("C15").Value = Range("A37").Value
        Range("C16").Value = Range("A38").Value
    End If
End Sub
Reply With Quote
  #5  
Old 02-19-2017, 02:37 PM
FUGMAN FUGMAN is offline Message Box to advise corrective action required Windows 10 Message Box to advise corrective action required Office 2016
Banned
Message Box to advise corrective action required
 
Join Date: Feb 2017
Posts: 55
FUGMAN is on a distinguished road
Default

jeffreybrown

Thanks a million. The "len" part is what I wasn't getting.
Reply With Quote
  #6  
Old 02-19-2017, 03:09 PM
jeffreybrown jeffreybrown is offline Message Box to advise corrective action required Windows Vista Message Box to advise corrective action required Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Awesome. You're welcome and glad you now have a workable solution.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for advise on the complex mixing of functions mcd.sg.11 Excel 2 05-31-2016 08:02 AM
Message Box to advise corrective action required Using IF statement to flag a required action stuwoolf Excel 4 01-28-2015 12:27 PM
Message Box to advise corrective action required Message replys are shown at the bottom of the message, how can I get them to the top Gardy Outlook 3 05-23-2012 01:20 AM
How to link an action on one slide on a powerpoint with the same action on another slevinmj PowerPoint 0 02-24-2011 05:38 AM
Sorting columns in Excel - please advise Jonre Excel 2 08-21-2009 02:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft