Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
667
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
(y)
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,215,972
Messages
6,128,030
Members
449,414
Latest member
sameri

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