We help IT Professionals succeed at work.

Set a Range to a Cell in Excel VBA

149 Views
Last Modified: 2017-04-21
I need to adjust some code from asking a user to select the starting cell to defining what the starting cell is

Currently I have a prompt of
Set Range2 = Application.InputBox("Set Starting Location (three columns):", xTitleId, Type:=8)

But I want to set the value to be Sheet 2 Cell C2 and not prompt the user.  I found this code but it does not work
Set Range2 = Application.Goto(ActiveWorkbook.Sheets("Sheet2").Range("C2"))

Help is greatly apprciated
Comment
Watch Question

Managing Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
that was it
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.