Fill down from D1 to active cell in excel ??

Hi all. I am trying to write a script to take the values from column A and subtract the value of A$1 from the rest of column A. To do this manually I set D1 = A1-A$1 and then fill down in column D to the last used row in column A. Then copy-special paste values from column D to column A. Below is what I have written so far, but the "select (ranges "D1" thru active cell)" selects cells D1 and the active cell ($D$5) not from cell D1 down to the active cell.
Any ideas for a newbie?
tell application "Microsoft Excel"
set formula of cell "D1" to "=A1-A$1"
select (get end range "A:A" direction toward the bottom)
set theEnd to (get first row index of active cell)
select cell 4 of row theEnd
select (ranges "D1" thru active cell)
fill down (ranges "D1" thru active cell)
end tell

I figured out a way to do what I was after, but I would think there is a more direct way of doing it.
If anyone has a way to slim down or clean-up this script, please let me know.
Here is the script I have now.
tell application "Microsoft Excel"
set formula of cell "D1" to "=A1-A$1"
select (get end range "A:A" direction toward the bottom)
set theEnd to (get first row index of active cell)
select column 4 of row theEnd
set lastRow to "D" & theEnd as string
set range1 to "D1:" & lastRow
fill down range (range1)
end tell

Similar Messages

  • "fill down" from dell containing letter X results in succeeding letters

    If I use the letter X as a placeholder in a cell and want to fill cells in successive rows with the same letter, I get y in the next cell, z in the next, etc. How can I tell Numbers to duplicate X in the succeeding rows?

    It's explained in the Help, chapter Autofilling Table Cells
    select cell A1 and cell A2, both containing X
    then drag the circular handle to the bottom.
    Yvan KOENIG (from FRANCE mardi 17 juin 2008 20:57:00)

  • Keep Auto Fill Down A Column With Blank Cells

    Hello,
    I understand if one blank cell is left, auto fill cannot continue through out the rest of the column.
    Is there a way to "trick" the cell into thinking there is information in the blank cell, in order for it to continue to auto-fill? 
    Please help

    You could enter a space in a cell - it will appear to be blank. An apostrophe will work too - this makes the cell contain an empty string value.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Creating a pop-down using a range of cells (Like Excel LIST feature)

    Can this be done in numbers. Instead of typing the data into a pop-up list to be pasted in an ongoing long spreadsheet, I was wondering if Numbers supports a similiar feature to Excel's MANAGE LISTS which allows the drop down to be locked to a range of cells instead. I know they are very similar, but wondering?
    -Kevin

    Kevin,
    Presently Drop-Down menu's can't be created from cell ranges in Numbers. It sounds like a good feature, and has been asked about many times here. You can Send Feedback to the Numbers team and tell them what you would like to see in the next version of Numbers. The Feedback link is under the Numbers menu item.
    Jerry

  • Fill down - how?

    I can find no way in Numbers of using fill down from the keyboard (ctrl+D in Excel). I know you can select a cell edge and drag down but there appears to be no keyboard shortcut (which is much faster and accurate).

    Welcome to Apple Discussions
    I agree, I also miss ⌘ D from AppleWorks. Still another thing to leave feedback to the Numbers team about.

  • How can I make fill down command NOT increment values?

    Hi,
    Is there anyway I can get the fill down command to insert the same value in each cell, rather than filling in an increasing series. It works fine for plain numbers (i.e. if I fill down from a cell containing "1", it gives a column with every cell containing "1").
    However, for dates and mixtures of text and numbers it always increments the values - example below:
    Doing fill down from cells containing:
    1 18 Mar 2009 abc100
    Gives:
    1 18 Mar 2009 abc100
    1 19 Mar 2009 abc101
    1 20 Mar 2009 abc102
    1 21 Mar 2009 abc103
    1 22 Mar 2009 abc104
    1 23 Mar 2009 abc105
    etc...
    How can I keep the dates and "abc100" the same in the filled cells?
    Thanks for any help!
    Jo

    I have no idea how the designers of Numbers determined when to fill down identical values versus incrementing the values. For instance, "abc100" increments in a fill down while "100" and "abc" do not. I, personally, see nothing special about "abc100" that indicates a pattern.
    And you are correct that Fill Down is different than dragging the circle. Fill down takes whatever is in the top cell and fills down (either incrementing or not, depending on whatever the rule is the designers chose) while overwriting whatever was in the lower cells. Dragging the circle of a box that covers 2 or more cells fills down from the bottom of the box and it looks for patterns, not just simple increments.
    No problem on the search. It isn't always easy to find what you are looking for. I just happened to remember that thread.

  • Three Numbers questions:how do you change the auto default background or fill color from white to another color to use in multiple succeeding operations?  what is the formula to express the ratio of two numbers as a percent?

    Numbers questioons:
    -how do I change the automatic default background fill color so it stays a non white color?
    -what is the formula to express the ratio of two numbers as a percentage?
    -how do I create a signal formula to be sue against an entire column of data (for example, if I wanted to multiply the each cell in the column by the number 10)?
    -I have created a spreadsheet in Numbers with header and rows labelled and it contains formulas as well.  I now want to create a new 'blank' of this template with same header and row names and formulas, but without the cell entries from my earlier exerciser so I can use again in the future. How do I do this?

    Hi Matt,
    For short columns, the easiest method is to select the cell containing the formula, then grab the fill handle (small circle at the botom right of the selected cell) and drag down.
    For long columns, use either Jerry's suggestion (copy/paste) or Insert > Fill > Fill Down.
    Copy/Paste:
    Select the cell containing the formula. Copy
    Select from the cell containing teh formula to the end of the column. Paste.
    Fill Down:
    After entering the formula, and pressing enter...
    Click on the column reference tab to select the whole column.
    Command click on each cell above the one containing the formula to remove it from the selection.
    When cell with the formula is the top cell in the selection, go Insert > Fill > Fill Down.
    Pick whichever is easiest.
    Regards,
    Barry

  • I cannot get GPS Only to work on my ipad3 (4g version, but not on an active cell plan, and wifi off).  Is there some new requirement in 7.1 or 7.1.1 to have cell and/or wifi enabled for GPS to work? I am testing with MotionX

    It seems like I cannot get GPS only to work on my ipad3 (4g version, but not on an active cell plan, and wifi off).  Is there some new requirement in 7.1 or 7.1.1 to have cell and/or wifi enabled for GPS to work? I am testing with MotionX, garmin blueChart mobile, and a GPS monitoring tool. All show no signal. If I turn on cell and wifi,  it says I get gps signal, but can't tell if that is from the GPS chip, or just from cell and wifi only (maybe with some gps mixed in)?  Any ideas on how to get iPad working with GPS only??

    Roger that.  Thanks for your time.
    System:
    Windows 7 64bit
    Processor: AMD phenom IIX4 965
    RAM:  Gskill Ripsaw F3-12800CL7D-4GBRM (2-2GB sticks)
    GPU:EVGA Classified Nvidia GeForce GTX 560 Ti 448 core
    PSU: Kingwin 1000W laser gold (LZG-1000)
    Yes. tried the one ram stick, no go.  I have been trying to boot off/install the windows 7 disk but am unable to get to the point where windows starts installing after its gathering information portion of the install.  I can get to the disk selection screen of the install with the WD HD on SATA port 2 but then get the "cant install messages" when I try to select the Vertex 3.  Yes I can see the Vertex 3 Drive as well as the WD drive at this point.  some times I have to hit "scan" a couple of times.

  • Drill-Down from several Charts to Same Target

    Hi,
    we have built a dashboard with 3 (soon to be 6) column charts and one line chart below. The colum charts represent 6 KPIs aggregated for a year for different warehouses. Each warehouse is a specific series (because we want them to have a individual colors). When the user clicks on a warehouse in one of the column charts, we want the line chart above to show the
    For this purpose, we have all column charts store drill-down values to the same two cells:
    - One cell stores the series name (warehouse selected)
    - One cell stores the name of the clicked line chart (we use a single cell with the chart name as source for the first series of each chart. After the first series is selected as the default drill-down, this source and destination seems to be used for every series selected, which might be a bug)
    Our problem is, all queries for the charts are loaded at startup. The default drill-downs for all charts are done, and we have a random chart in the drill-down destination. If the user clicks the same chart again, we do not notice this as the value of our target cell does not change. We have tried several solutions for this, but nothing is really satisfactory.
    Does any of you have an idea, or a similar dashboard maybe, where the drill-down of several charts (preferably with several series per chart) is stored into a single target chart?
    Thanks & Regards,
    Sebastian

    Hi Sebastian,
    You cannot have drill downs from different charts to the same target.
    As per your scenario you have 3 column charts with warehouses displaying their respective 3 KPI's values. I believe you would have created a series each for available warehouses. If you have selected drill down on load for all the column charts with one single target then at load all the three column charts will try to place the destination of their selected series(based on warehouse selected) to the same target.
    And also as you mentioned when the user tries to select the same chart again the target doesn't change, the reason is the same as all the charts are trying to put the destination of the series in the same cell.
    Instead of doing it this way, what you could do is to name the series of all column charts the same and have the series name put into one cell. Then based on this series name you can lookup the data for that warehouse and display it in the line chart.
    Here again the user has to select the same warehouse in all the three column charts else it wont work.
    Hope this was useful =]
    Thanks & Regards
    Arjun.C.T

  • Is there a fill down in Numbers for iPad?

    Is there a fill down function in Numbers for iPad?
    Is there a good place to find these types of answers?
    Thanks!

    Hi Joe,
    Is there a fill down function in Numbers for iPad?
    Yes
    Is there a good place to find these types of answers?
    The Help in Numbers app
    or
    http://help.apple.com/iwork/1.2/safari/interface/?lang=en#button-2
    for explanation of filling follow
    +Numbers Help -> Data and functions -> Enter data into a table cell -> Fill a row or column with a logical range of data:+
    Anakonda

  • Fill-down function not working for resources.

    Hi,
    I am running P6 version 8.2 and I am trying to use the 'fill-down' function to copy resources down for certain filtered activities but the option is always greyed out.
    I can fill down just about anything else but for some reason it doesn't work with resources.
    Can anyone fill me in on why this may be..?
    Thanks.
    Russell.

    You can't use fill down on any column that is a list. Predecessors, Successors, Resources, Roles and Activity Codes can all be assigned to multiple activities by highlighting them, right clicking and going to Assign. This will bring up a window where you can choose what to assign.
    I am not 100% sure on why you can't use fill down with resources but I imagine its because you are doing more than editing a value for each activity. You are linking an activity to a resource, each of which are objects in the database.

  • How to fill a date series but skip cells

    How do you fill a date series, but skip cells.

    Wayne Contello wrote:
    A1 is the starting date
    A3=A$1+(ROW()-1)/2
    copy cell A3 and paste in A5, 7, 9, etc
    Alternatively,
    A3 = A1+1
    Leave A2 blank
    Select cells A2 and A3 then grab the "fill" handle (the little yellow circle) and drag down to fill in the rest of the column with the pattern of alternating date/blank cells

  • Fill down in Tables

    In InDesign tables, is there a way to fill cells with the same content, like Excel when you select a number of rows in a column and click Edit/Fill/Down?

    @Clark – more or less something like that, yes.
    But the appearance (fill, stroke, text formatting … ) of the cell travels over:
    The copy/paste examples
    Easy example:
    1. Select a cell ( ! not the text in a cell, the cell itself ! ) On Mac cmd + #
    2. Copy
    3. Select more than one cell
    4. Paste
    Advanced example:
    1. Select more than one cell
    2. Copy
    3. Select 2 times or more cells you have copied
    4. Paste
    Uwe

  • "Fill Down" automatically creates series of dates

    Stupid question perhaps, but here goes:
    I'm working with a spreadsheet that has a date column.
    I typed a date into a cell then attempted to copy that same date into some cells below it by using the "fill down" command. Instead, it created a series of dates, adding one day per row.
    Isn't there some way to just copy the date to the cells below without creating a series???
    Thanks!

    micheleandray wrote:
    Isn't there some way to just copy the date to the cells below without creating a series???
    Michele,
    Copy/Paste and Fill are different operations and have different results. Had you Copied the first entry and Pasted it to the remaining cells, you would have gotten the result you wanted. The Fill feature assumes that you want a series rather than a duplication.
    Jerry

  • Drilling down from OmniPortlet chart to detailed chart in same OmniPortlet?

    I am trying to use OmniPortlets to create a dashboard of charts showing different metrics.
    I want to be able to drill into each chart to get a more detailed chart in the SAME OmniPortlet frame with all the other charts being unchanged. So if I have 3 OmniPortlet charts C1, C2, C3 in the same page, I want to be able to click on C1 and to be able to drill into C1 (details), C2 and C3.
    I am trying to do this through OmniPortlet events, parameters and page parameters.
    1) I've defined a OmniPortlet Param1 to parameterize the source of data - So my source URL is http://<URL-base>/##Param1##
    2) I then defined a Page Parameter PP1 that is associated with Param1 and set a default value for this (to make sure ##Param1## gets set for the top level chart). I set this default value in the OmniPortlet Parameters page - (otherwise, the ##Param1## seems to map to a null sting despite the Page Parameter PP1's default value)
    3) Finally, I defined an OmniPortlet event that gets fired when I click on the chart. The Event sets as one of its parameters, the data source that has the drilldown data. This column name is PP1.
    So, the chart should first display with the data source URL being initialized from the Page Parameter. When I click on the chart, the Event should set up a new parameterized value in the data source so that next chart with drill down data is shown after a page refresh.
    The reality is different from this theory. When I click on the chart, for some reason, the value of Param1 for refreshed Omniportlet display seems to be getting blanked out. So my chart definition gets messed up since the data source is now invalid. The page however continues displaying the original (pre-drill) chart from the cache.
    2)
    I don't know whether this problem is because of an improper use of the Page Parameters and OmniPortlet events or whether this is because I seem to be forced to set Param1's default value (maybe this is overriding my data source URL even in the drill down chart).
    There seem to be some examples of the chart click causing another chart to refresh. These docs don't have a lot of detail, plus I want the SAME OmniPortlet to show the drill down chart.
    Has anybody done this? Any pointers would be appreciated..

    Hi Sebastian,
    You cannot have drill downs from different charts to the same target.
    As per your scenario you have 3 column charts with warehouses displaying their respective 3 KPI's values. I believe you would have created a series each for available warehouses. If you have selected drill down on load for all the column charts with one single target then at load all the three column charts will try to place the destination of their selected series(based on warehouse selected) to the same target.
    And also as you mentioned when the user tries to select the same chart again the target doesn't change, the reason is the same as all the charts are trying to put the destination of the series in the same cell.
    Instead of doing it this way, what you could do is to name the series of all column charts the same and have the series name put into one cell. Then based on this series name you can lookup the data for that warehouse and display it in the line chart.
    Here again the user has to select the same warehouse in all the three column charts else it wont work.
    Hope this was useful =]
    Thanks & Regards
    Arjun.C.T

Maybe you are looking for

  • Invalid Parameter Bindings

    Hi there! I'm writing a Stock Take (Inventory Control) system. I need to create some temporary rows from one table into another in order to do some calculations. I'm trying to add rows to a STOCK_TmpQOH table. I get the values from a STOCK_TmpQOH tab

  • Stuck in grayscale, can't access image mode rgb

    For some reason photoshop decided I didn't want to work in color on a certain image anymore, and isn't allowing me to access the usual fix for undoing grayscale. I've been pulling my hair out trying to recover this image and can't find a solution onl

  • Windows 7 64bit no longer recognizes my iPod as of iTunes 10

    So as of 3 iTunes updates ago, which would be iTunes 10, my computer with windows 7 64bit no longer recognizes my iPod clickwheel, telling me the device has malfunctioned.. which it hasn't it works just fine with my windows XP pro machine. I tried up

  • Reg : Button Option in Work item

    Hi All, I want to display a button in workitem. When user click on it. it keep the workitem in the inbox and take him to message creation where he can write his query and send it. Let me explain it. The requirement is that  when any workitem is creat

  • Need help with reporting

    I am very confused and frustrated with this whole process. I got Captivate to build a on line teaching tool for my office employees. After creating the training I found that you have to have a place to host it.  I found a web host, and made a website