Referencing named ranges in procedures- excel2007

beckyinDC

Board Regular
Joined
Mar 24, 2011
Messages
56
I am finding a lot of informtion about how to create named ranges and scope them Workbook or Worksheet. But I must be misunderstanding something bout how to reference them in the VBA procedures:

I have Active X checkbox that when clicked, I want to display 5 rows and select a particular field.

I tried to use a named range for the rows and when that code ran, it said an object was needed. i fiddled by prefixing with worksheet name, etc...finally went with actual range and deleted the name which had referenced the 5 rows. That worked.

Thought I could at least use a named range for the select (wanted some success with the technique)...but this code isnt working:

Private Sub chkUploadtoCCRMSharepointSite_Click()
If chkUploadtoCCRMSharepointSite = False Then 'Hide Them
Range("32:36").EntireRow.Hidden = True
Else
Range("32:36").EntireRow.Hidden = False
Sharepoint_Project_Application.Select
End If
End Sub

Sharepoint_Project_Application is the named range for one cell defined absolutely. It has Workbook scope. In Name Manager, I can see the value for it.

This procedure is on the worksheet page- same worksheet where th cell is.

Error message indicates object is needed for the select line- I must not be referencing the cell correctly. Cant seem to see value in Watch window. Have been fiddling with ways to reference it, and looking for examples---any help appreciated- thank you!

using Excel 2007
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,574
Messages
6,179,629
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top