Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
G'day there Tom,
Set gRng = Nothing On error Resume Next Set gRng = dSht.Range("wrkRanks") On Error goto 0 Of course!! That makes sense. I've used the "on error" construct elsewhere, but I thought that using it here would just translate the same error to another location. Then when using gRng if not gRng is nothing then - code to use gRng End if I had used the "if not" line with the above "Set" command, but without success. This way looks much more logical. gRnd doesn't refer to the named range wrkRanks. Well, there was my first mistake =) It refers to the range defined by wrkRanks when you set the variable. That was my second, and was what I learned from those mistakes. So it wasn't a totally wasted experience. The only way to refresh that range as you call it is to set it again or instead of using a variable, use dSht.Range("wrkRanks") directly. OK, I can see the mechanism behind it all. Unfortunately, "Set"ting it again or using the direct approach introduces other problems that I'd rather not try to deal with at the moment. (Translate that to mean, "I've not figured out how to do it". I'll stick with your "On error" & "if not" techniques and exit the subs as necessary. Thanks very much for your assistance, and explanation, Tom. I really do appreciate the effort you put in to helping me learn. See ya -- Ken McLennan Qld, Australia |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
why do i "sometimes" need to "edit chart object" before "source da | Charts and Charting in Excel | |||
Excel 2007: "Reference is not valid" when refreshing pivot table | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
"Problems obtaining data" error refreshing Excel pivottable | Excel Programming |