View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Madiya Madiya is offline
external usenet poster
 
Posts: 239
Default Named range by VBA to another workbook

Hi,
I am trying to set named range by VBA to another workbook.


Dim LR As Integer
Dim I As Integer
Dim J As Integer
Dim WRM As Workbook
Dim SDR As Worksheet

Set WRM = Workbooks("RUIM new.xls")
Set SDR = WRM.Sheets("Damage Receipt")
For I = 1 To 12
ActiveWorkbook.Names.Add Name:=SDR.Cells(1, I).Value, _
RefersTo:=SDR.Range((Cells(1, I)), Cells(20000, I)),
Visible:=True <<<ERROR
Next

I am getting error on the above statement.
Need help.
Regards,
Madiya