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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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

Forum statistics

Threads
1,223,791
Messages
6,174,605
Members
452,574
Latest member
hang_and_bang

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