View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Problems with setting .Values with vba

On Thu, 17 May 2012 23:10:36 +0000, confusedXLuser wrote:

Can anyone tell me why what appears to be the same string apparently
isn't?


Your second string is missing a right parenthesis:

RangeStr = "=('2012'!R10C2:R10C27,'2012'!R34C2:R34C28)"
-- =('2012'!R10C2:R10C27,'2012'!R34C2:R34C28)

RangeStr = "=('" & MyYear & "'!R10C2:R10C27,'" & MyYear & "'!R34C2:R34C28"
-- =('2012'!R10C2:R10C27,'2012'!R34C2:R34C28