Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2021, 10:56 PM
Guessed's Avatar
Guessed Guessed is offline Good tutorials for ListBox /CombiBox (tweaking MsgBox)? Windows 10 Good tutorials for ListBox /CombiBox (tweaking MsgBox)? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The best choice would be to create a userform where you can design an interface to give the users the best experience.

The simplest coding choice is to use an InputBox and tell them what to enter via a key


Code:
Sub PickOne()
  Dim iResp As Integer, sMsg As String
  sMsg = "Selected Pictures:" & vbCr & "  Type 1 for 90 degrees" & vbCr & _
          "  Type 2 for 180 degrees" & vbCr & "  Type 3 for -90 degrees" & vbCr & vbCr & _
          "All Pictures:" & vbCr & "  Type 4 for 90 degrees" & vbCr & _
          "  Type 5 for 180 degrees" & vbCr & "  Type 6 for -90 degrees"
  iResp = InputBox(sMsg, "Make a Selection", "1")
  
  Debug.Print iResp
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 09-22-2021, 03:45 PM
James Martin James Martin is offline Good tutorials for ListBox /CombiBox (tweaking MsgBox)? Windows 10 Good tutorials for ListBox /CombiBox (tweaking MsgBox)? Office 2019
Novice
Good tutorials for ListBox /CombiBox (tweaking MsgBox)?
 
Join Date: Sep 2021
Posts: 7
James Martin is on a distinguished road
Default

Hi Guessed,I tried the InputBox, it works as a standalone sub. Just not sure how to link to my rotation macros, do I need to assign the value for rotation seperately for the InputBox selections? I tried deleting out degrees after the rotation value, and making it a private sub, each time replacing the rotation value with "PickOne". I guess I am going to have to combine Macro r and Macro R into one, with the permutations executing after the InputBox in an or scenario? Thanks James Martin
Code:
Sub MacrorSelectedImage()
Application.ScreenUpdating = False
Dim iShp As InlineShape, Shp As Shape
For Each iShp In Selection.Inlineshapes
'For Sub MacroRSelectAllImages() insert this line:
'For Each iShp In ActiveDocument.InlineShapes
With iShp
   If .Type = wdInlineShapePicture Then
     Set Shp = .ConvertToShape
     With Shp
     .Rotation = 90
     .ConvertToInlineShape
     End With
   End If
End With
Next
Application.ScreenUpdating = True
End Sub


Quote:
Originally Posted by Guessed View Post
The best choice would be to create a userform where you can design an interface to give the users the best experience.

The simplest coding choice is to use an InputBox and tell them what to enter via a key
Code:
Sub PickOne()
  Dim iResp As Integer, sMsg As String
  sMsg = "Selected Pictures:" & vbCr & "  Type 1 for 90 degrees" & vbCr & _
          "  Type 2 for 180 degrees" & vbCr & "  Type 3 for -90 degrees" & vbCr & vbCr & _
          "All Pictures:" & vbCr & "  Type 4 for 90 degrees" & vbCr & _
          "  Type 5 for 180 degrees" & vbCr & "  Type 6 for -90 degrees"
  iResp = InputBox(sMsg, "Make a Selection", "1")
  
  Debug.Print iResp
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Could somebody help me with the code of my VBA userforms(Combibox - saving - editing of data) 19339 Excel Programming 2 09-14-2018 12:06 AM
anyone knows any good tutorials on recording macros in Word? thanh Word 1 08-16-2017 06:16 AM
Good tutorials on recording macros in Microsoft Word nathan123 Word VBA 2 05-22-2015 10:54 AM
Good tutorials for ListBox /CombiBox (tweaking MsgBox)? Good tutorials on macros karen.drummond2 Word VBA 2 04-04-2013 07:33 AM
Good tutorials for ListBox /CombiBox (tweaking MsgBox)? Good Tutorials for Reccording Macro's Rohan Word 1 01-09-2010 11:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:23 PM.


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