[AccessD] Manipulating Excel Cells

Gustav Brock Gustav at cactus.dk
Thu Feb 2 04:12:22 CST 2006


Hi Stuart

Well well, I hope everyone can see I used _two_ lines, still the essential code is one line. Also, I imagined that if you need this kind of code, you will be working in a worksheet, thus wks (or whatever you have chosen to call your worksheet object) will have been created previously.

However, should that not be the case, and you cannot or will not manage the line of code for creating the worksheet object, you can follow this route:

  Worksheets(n).Columns( .. ..

or even

  ActiveWorkbook.Worksheets(n).Columns(

You will need to replace n with the index/name of the worksheet (1, 2, 3 etc. or "Sheet1" etc.) or - gosh - insert another line of code:

  n = 1

or

  n = "Sheet1"

/gustav


>>> stuart at lexacorp.com.pg 02-02-2006 10:22:54 >>>
On 2 Feb 2006 at 10:08, Gustav Brock wrote:

> Hi John and Stuart
> 
> But where would you need that? And if, one line of code will do:
> 
>   lngCol = 53
>   strCol = Left(wks.Columns(lngCol).Address(False, False), 1 + Sgn(lngCol \
>   27))
> 
>   strCol = "BA"
>   lngCol = wks.Columns(strCol).Column
> 

Not really one line.  You need to create  "wks" 


-- 
Stuart





More information about the AccessD mailing list