View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Can't concatenate

You need code like

Set SrcWksht = ThisWorkbook.Worksheets("Sheet1")
wkshtmon.Name=srcwksht.name & " - Monthly"

Note the space before the & character. Without the space, VBA
treats the & character as a data type conversion operator.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"davegb" wrote in message
oups.com...
What's wrong with this:

Dim SrcWksht As Worksheet
Dim WkshtMon As Worksheet

Set SrcWksht = ThisWorkbook("Sheet1")

wkshtmon.Name=srcwksht.name&" - Monthly"<---Compile error -
expected
end of statement

Thanks.