I'm sure this is a simple one liner, but it escapes me (as do most things).
I'm trying to set a variable for a range based on the cells selected. For example, I want variable "myrange" to be set to range("A1:D14") if I click on cell A1 and drag it to D14.
So far everything I've tried ends up getting the good old "1004 - Application defined or object defined error"
Thanks!
Last edited by JP Romano; 10-02-2009 at 11:08 AM. Reason: I'm an idiot
Do you mean
Dim myRange As Range Set myRange = Selection 'do stuff Set myRange = Nothing
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Talk about a real dummy mistake...I'm actually embarrased to elaborate. Thank you, as always.
At least now you know it's Friday...![]()
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Thanks... lack of sleep must be taking it's toll!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks