Shamil Salakhetdinov
shamil at users.mns.ru
Wed Aug 17 05:45:27 CDT 2005
> Also - you called this refactoring. I've heard that term before > - what does it mean? http://en.wikipedia.org/wiki/Refactoring http://www.refactoring.com Although the code change was more than refactoring - it was code fixing + refactoring... Shamil -- Web: http://smsconsulting.spb.ru/shamil_s ----- Original Message ----- From: "Dan Waters" <dwaters at usinternet.com> To: "'Discussion of Hardware and Software issues'" <dba-tech at databaseadvisors.com> Sent: Wednesday, August 17, 2005 1:47 AM Subject: RE: [dba-Tech] OT - Excel VBA Cell Selection Syntax (x-posted) > Yahoooo! > > That worked like a charm! > > Also - you called this refactoring. I've heard that term before - what does > it mean? > > Dan Waters > > > -----Original Message----- > From: dba-tech-bounces at databaseadvisors.com > [mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Shamil > Salakhetdinov > Sent: Tuesday, August 16, 2005 3:53 PM > To: Discussion of Hardware and Software issues > Subject: Re: [dba-Tech] OT - Excel VBA Cell Selection Syntax (x-posted) > > Dan, > > Both work OK here with MS Excel 2003 when ("Available Items") is active > worksheet. > I think you need to refactor your code to have: > > Dim wks As Excel.Worksheet > Set wks = Worksheets("Available Items") > wks.Select > wks.Range(wks.Cells(2, 1), wks.Cells(123, 2)).Select > > HTH, > Shamil > -- > Web: http://smsconsulting.spb.ru/shamil_s > > ----- Original Message ----- > From: "Dan Waters" <dwaters at usinternet.com> > To: "DBA-Tech" <dba-tech at databaseadvisors.com>; "AccessD" > <accessd at databaseadvisors.com> > Sent: Tuesday, August 16, 2005 6:47 PM > Subject: [dba-Tech] OT - Excel VBA Cell Selection Syntax (x-posted) > > > > Hello to All, > > > > I'm struggling with syntax for the selection of cells when trying to use > row > > and column indexes. Below is an example: > > > > Example A: > > Worksheets("Available Items").Range("A2:B123").Select > > > > Example B: > > Worksheets("Available Items").Range(Cells(2, 1), Cells(123, 2)).Select > > > > Example A works fine, but B does not. Both are from Excel Help files (see > > the Range Property). Once this works I will substitute a variable for the > > 123 value. > > > > Thanks! > > Dan Waters > > > > _______________________________________________ > > dba-Tech mailing list > > dba-Tech at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/dba-tech > > Website: http://www.databaseadvisors.com > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com > > _______________________________________________ > dba-Tech mailing list > dba-Tech at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-tech > Website: http://www.databaseadvisors.com