View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mangesh_yadav[_207_] mangesh_yadav[_207_] is offline
external usenet poster
 
Posts: 1
Default macro can't form a Range on an inactive Worksheet


instead of
Set rNewRange = ActiveWorkbook.Sheets(sInSheet). _
Range(Cells(1, 2), Cells(5, 6))

use
Set rNewRange = ActiveWorkbook.Sheets(sInSheet). _
Range(Sheets(sInSheet).Cells(1, 2), Sheets(sInSheet).Cells(5, 6))

- Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=318972