Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Rob,
(Thanks also to Tom Ogilvy for your response on this matter which may highlight potential problems - as a newby I originally searched for a response via my ISP server & this was not accessible after a short period of time. I now know how to access directly from the MS site). Unfortunately my code is riddled with applucations of the Select method. A simple example of how I invoke this is as follows: Public Sub GetClientMap() Dim SectRng, MapRng As Range Range(MapRng(2, 1), MapRng(MapRng.Rows.Count - 1, MapRng.Columns.Count)).Copy SectRng(2, 1).Select ActiveSheet.Paste End Sub Are you suggesting I should convert the range contents to an array or some other method? Thanks in anticipation, Tom -----Original Message----- Hi Tom, The best way to prevent this error is not to use the Select method in your code. There are almost no situations in VBA that require you to explicitly select a cell. Everyone starts out coding this way because that's how the macro recorder does it, but it's not really the best way to do things. If you post an example of code that's giving you problems, I'm sure we can show you how to rewrite it sans Select. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "tielle" wrote in message ... I have recurring problems with Run-time errors (1004) with the message 'Select Method of Range Class failed' when using the Select method on a Range object within Excel VBA macros. The same code works successfully many times but seems to trip up unexpectedly. Does anyone have a smart way of avoiding this or can hint as to how it might be occurring? I know for instance it has greater risk of occurring when a proedure is run from within the VBE editor than say a control button in the workbook. Regards, -- Tom Lambert . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I remove multiple 'errors' in Excel error checking, at the same time??? | Excel Discussion (Misc queries) | |||
#N/A errors when matching time values | Excel Worksheet Functions | |||
Run time errors | Excel Discussion (Misc queries) | |||
Excel Run Time Errors | Excel Discussion (Misc queries) | |||
Unresolved Errors in IF Statements - Errors do not show in results | Excel Worksheet Functions |