Re: End of column in Excel
Re: End of column in Excel
- Subject: Re: End of column in Excel
- From: David Emmons <email@hidden>
- Date: Mon, 28 Jan 2002 23:39:44 -0500
In vba we wouldn't do it that way...
we would find the Begining cell and the endcell (doing an end up from row
65536 would give you the absolute bottom of your column) , set it as a range
and then set the Range's FORMULA to your FORUMULa using R1C1 notation. When
you use a range this way it sets the formula of ALL cells in that Range to
that formula. It's like doing a paste formula command manually.
Here is the psuedo code>
Sub DoTheTrick()
dim myRange as Range
set myRange = Range(Range("B1", Range("B65536").end(xlUp))
myRange.Formula = "YOUR FORMULA HERE, USE R1C1 IF YOU WANT REFERENCES TO
BE REALATIVE"
End Sub
you could write it as a VBA routine and call it from AS from my
understanding of AS (which is not as high as my understanding of VBA, which
I use for work...)
Good Luck.
-Dave
>
From: Jay Young <email@hidden>
>
Date: Mon, 28 Jan 2002 17:32:52 -0600
>
To: email@hidden
>
Subject: End of column in Excel
>
>
Hi,
>
>
I'm trying to select all the text from a column in Excel without
>
selecting the empty cells at the end, but can't figure it out. My plans
>
are to create a formula in column 2 next to the first cell in column 1
>
and then drag that formula down using autofill to the last line of text
>
in column 1. I've got most of this figured out (thanks to Excel's
>
recording capabilities) but getting the autofill to stop at the last
>
line of text of column 1 is what I can't figure out. This is what I've
>
come up with so far for finding the last cell in column 1:
>
>
tell app "MicroSoft Excel"
>
get LastCell (column 1) direction xlDown
>
end tell
>
>
This works unless you have an empty cell in the column somewhere between
>
the text. So for example if I had this in column 1:
>
>
Business Numbers
>
555-5555
>
(blank cell)
>
777-7777
>
888-8888
>
>
then the code would get 555-5555 and not 888-8888 from column 1. Is it
>
possible to do something like this? I'm thinking that if I can find the
>
last cell I can count the cells up to the last one and tell column 2 to
>
autofill that amount of cells. Thanks for your help.
>
>
Jay
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.