![]() |
Dynamic Name Range using VBA
Hi,
I need to create sheet level Dynamic range names in a workbook using VBA.. This is what I insert in the RefersTo box while creating a name manually: =OFFSET(Sheet1!$B$3,0,0,COUNTA(Sheet1!$B$3:$B$500) ,1) How do I do it in VBA? Thanks in Advance for the help. Regards, Raj |
Dynamic Name Range using VBA
Try recording a macro while doing
Sub Macro3() ' ' Macro3 Macro ' Macro recorded 4/20/2010 by Donald B. Guillett ' ' ActiveWorkbook.Names.Add Name:="xxx", RefersToR1C1:= _ "=OFFSET(Sheet1!R1C1,1,1)" End Sub ============ or Sub makename() ActiveWorkbook.Names.Add Name:="yyy", RefersTo:= _ "=OFFSET(Sheet1!$B$3,0,0,COUNTA(Sheet1!$B$3:$B$500 ),1)" End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Raj" wrote in message ... Hi, I need to create sheet level Dynamic range names in a workbook using VBA.. This is what I insert in the RefersTo box while creating a name manually: =OFFSET(Sheet1!$B$3,0,0,COUNTA(Sheet1!$B$3:$B$500) ,1) How do I do it in VBA? Thanks in Advance for the help. Regards, Raj |
All times are GMT +1. The time now is 04:39 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com