Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2020, 09:04 AM
14spar15 14spar15 is offline Help with setting MySelection Windows 7 64bit Help with setting MySelection Office 2010 64bit
Advanced Beginner
Help with setting MySelection
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default Help with setting MySelection

Hello, I am using this to select my selection.

Set MySelection = Application.InputBox(prompt:="Select a range of cells", Type:=8)



My range is always 4 columns wide and 34 rows deep. Rather than selecting this 4x34 selection each time, could this line be modified so that I would always just pick the single top left cell of my desired 4x34 selection and MySelection would end up being the complete 4x34 selection based off the selected cell. Thank You
Reply With Quote
  #2  
Old 10-14-2020, 09:23 AM
Purfleet Purfleet is offline Help with setting MySelection Windows 10 Help with setting MySelection Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

You can use MySelection.CurrentRegion.Select and then click anyway in the range to select the table (as long as there is nothing around it)

Dont forget to attach example worksheets so that we dont have to try and recreate the test data
Attached Files
File Type: xlsm Help with setting MySelection_purfleet.xlsm (14.4 KB, 7 views)
Reply With Quote
  #3  
Old 10-14-2020, 09:35 AM
Logit Logit is offline Help with setting MySelection Windows 10 Help with setting MySelection Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Paste this into a REGULAR MODULE :

Code:
Option Explicit

Sub AutoRngSel()
    ActiveCell.Offset(, 4).Resize(34, 4).Select
End Sub
You will need a COMMAND BUTTON on the sheet connected to this macro.

Select the upper left cell of the range to be highlighted .. click the button.
Attached Files
File Type: xlsm Range Auto-Select.xlsm (14.6 KB, 6 views)
Reply With Quote
  #4  
Old 10-14-2020, 03:43 PM
14spar15 14spar15 is offline Help with setting MySelection Windows 7 64bit Help with setting MySelection Office 2010 64bit
Advanced Beginner
Help with setting MySelection
 
Join Date: Mar 2011
Posts: 97
14spar15 is on a distinguished road
Default

I probably didn't explain this exactly right but I was able to use a combination of both of these to get the job done. I like the way that Purfellt uses the active cell as a starting point. I did not need the offset. I combined them with this and it seems to work well for me. Thanks for the help
Reply With Quote
  #5  
Old 10-14-2020, 03:45 PM
Logit Logit is offline Help with setting MySelection Windows 10 Help with setting MySelection Office 2007
Expert
 
Join Date: Jan 2017
Posts: 529
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Glad you have an answer.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with setting MySelection Setting up MS Outlook chester1993 Outlook 2 09-06-2014 08:34 PM
Help with setting MySelection Setting up resources icw Project 2 09-04-2011 03:55 AM
Help with setting MySelection Setting up an account alexb123 Outlook 1 07-27-2011 10:55 AM
Can I get some help setting this up please? Moiraes Fate Office 0 05-18-2007 12:22 PM
setting rules isapaine Misc 0 01-11-2006 07:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:05 AM.


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