View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arturo Arturo is offline
external usenet poster
 
Posts: 108
Default Globally Named Range Problem

Hello,
Im wondering if theres away to add a named range to a specified sheet
without selecting that sheet first. I can get a row count from a sheet while
its not active€¦

Public MASTERwb As Workbook

Sub ScaleVLU()
Dim RowCnt As Integer

Set MASTERwb = ActiveWorkbook
MASTERwb.Sheets(€śabc€ť).Select
RowCnt = MASTERwb.Sheets(€śabc€ť).UsedRange.Rows.Count
MASTERwb.Names.Add Name:="VLU", _
RefersTo:="=" & MASTERwb.Sheets(€śabc€ť).Range("A1:D" & RowCnt).Address
End Sub

Appreciatively,
Arturo