input box

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
675
Office Version
  1. 365
Platform
  1. Windows
hi,

i need to create a input box so when the user puts the text into, it will place the text in d1 on sheet 2

I am able to do the above only on sheet 1 . Can anyone help?

KR
Trevor3007
 
So, is that what the other code is?
Did you see the issues I pointed out with that code, and the suggestions Kenneth and I made?


Hi joe,

I think I have sorted . Using the following:-

Sub renametab()
'
' renametab Macro
Dim myValue As Variant
Dim ws As Worksheet


'Sheet3 is sheets code name DO NOT CHANGE
Set ws = Sheet3

Do
'show inputbox
myValue = InputBox("Enter New Name", "Enter Tab Name")
'cancel pressed
If StrPtr(myValue) = 0 Then Exit Sub
'loop until tab name entered
Loop Until Len(myValue) > 0

'change to proper case
myValue = Application.WorksheetFunction.Proper(myValue)

'update sheet
With ws
'add name to cell
.Range("D1").Value = myValue
'change tab name
.Name = CStr(myValue) & "-data"
End With

End Sub


many thanks again for your help & Ken too BTW
:beerchug:
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,224,833
Messages
6,181,240
Members
453,026
Latest member
cknader

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