To include Depot

  • Thread starter Thread starter Steved
  • Start date Start date
S

Steved

Hello From Steved

Set wksT = GetWorksheet(wks.Parent, _
"Sheet" & Left(cell.Text, 2))

I've made Changes to the above

Set wksT = GetWorksheet(wks.Parent, _
"" & Left(cell.Text, 8))

It now names the sheet "Papakura" instead of SheetPapakura.
Please what Do I enter in the above code to add Depot
as an example "Papakura Depot".

Thankyou.
 
you can't have spaces in sheet names.

Set wksT = GetWorksheet(wks.Parent, _
"" & Left(cell.Text, 8)) & "_Depot"
 
Set wksT = GetWorksheet(wks.Parent, _
Left(cell.Text, 8) & "Depot")
 
Sorry. First response didn't have a space before "Depot".

Set wksT = GetWorksheet(wks.Parent, _
Left(cell.Text, 8) & " Depot")

If you want the whole name, plus " Depot" use:

Set wksT = GetWorksheet(wks.Parent, _
cell.Text & " Depot")
 
Right Tom, no spaces in names. Uh, I knew that. Time to turn in for me.
 
Hello folks from Steved

Used below and works a treat
ps Swanson Depot that's what I got

Set wksT = GetWorksheet(wks.Parent, _
"" & Right(cell.Text, 8) & " Depot")

Thankyou.
 
you can't have spaces in sheet names.

Huh? Worksheet names can certainly contain spaces.

Worksheets(1).Name = "the name"

works fine for me.
 
Bob,
I was thinking of Defined Names/Named Ranges - Certainly you can have a
space in a worksheet name. My mistake.
 
you can't have spaces in sheet names.
I was thinking of Defined Names/Named Ranges - Certainly you can have a
space in a worksheet name. My mistake.
 
Thanks for the help Chip.

Can you use Instr without the 1 as the first argument? <g>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top