Inputbox and Object name

buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
I am trying to get an inputbox name a shape within my workbook. This is what I have so far and i am getting a Run-time error ("The specific value is out of range") on the part in red. Any code help would be great.

Code:
Dim MyInput
Sheets("List Form").Select
    ActiveSheet.Shapes.Range(Array("BlankTestButton")).Select
    Selection.Copy
    Sheets("For Copy").Select
    Range("A36").Select
    ActiveSheet.Paste
    Range("B37").Select
InputBox ("What would you like to name this shape?")
    Sheets("For Copy").Shapes.Range(Array("BlankTestButton")).Select
         [COLOR=Red]Selection.ShapeRange.Name = MyInput[/COLOR]
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I am trying to get an inputbox name a shape within my workbook. This is what I have so far and i am getting a Run-time error ("The specific value is out of range") on the part in red. Any code help would be great.

Code:
Dim MyInput
Sheets("List Form").Select
    ActiveSheet.Shapes.Range(Array("BlankTestButton")).Select
    Selection.Copy
    Sheets("For Copy").Select
    Range("A36").Select
    ActiveSheet.Paste
    Range("B37").Select
InputBox ("What would you like to name this shape?")
    Sheets("For Copy").Shapes.Range(Array("BlankTestButton")).Select
         [COLOR=Red]Selection.ShapeRange.Name = MyInput[/COLOR]

I think you need to set "MyInput" equal to something
you can set it to a range by doing
Rich (BB code):
Dim myInput As String
myInput = Worksheets("Sheet1").Range("A1").Value
 
Upvote 0
I think you need to set "MyInput" equal to something
you can set it to a range by doing
Code:
Dim myInput As String
myInput = Worksheets("Sheet1").Range("A1").Value

Nevermind, I think this is more what you want. To save what you enter as a string use something like this:
Code:
Dim MyInput As String
    MyInput = InputBox("Please enter info", "Data Entry")
 
Upvote 0
Yeah that's perfect thanks... I knew I was forgetting something :)
 
Upvote 0

Forum statistics

Threads
1,215,558
Messages
6,125,507
Members
449,236
Latest member
Afua

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top