+ Reply to Thread
Results 1 to 4 of 4

Location of Cell Between Embedded Chart

Hybrid View

Guest Location of Cell Between... 02-23-2006, 02:10 PM
Guest Re: Location of Cell Between... 02-25-2006, 05:35 PM
Guest Re: Location of Cell Between... 02-25-2006, 06:45 PM
Guest Re: Location of Cell Between... 02-26-2006, 04:30 PM
  1. #1
    Bill
    Guest

    Location of Cell Between Embedded Chart

    I have a chart embedded on a worksheet. I would like to select the cell
    just below the chart. Is there a way of finding that location?

    Thanks,

    Bill



  2. #2
    Tim Barlow
    Guest

    Re: Location of Cell Between Embedded Chart

    Bill,

    AFAIK, there is no easy lookup - you have to work it out:

    1. Determine the position of the chart and its height on the sheet:

    Dim baseline as Double
    With ActiveSheet.ChartObjects("Chart 1")
    baseline = .Top + .Height
    End With

    2. Add together the heights of all the rows until the sum is greater than
    the baseline above:

    Dim aRow As Long
    Dim cumRowHt As Double

    Do
    aRow = aRow + 1
    cumRowHt = cumRowHt + Rows(aRow).RowHeight
    Loop Until cumRowHt > baseline
    Cells(aRow + 1, 2) = "Put text Here"


    You can do something similar with the left & width properties to determine
    which column.

    HTH

    Tim



    "Bill" <bill@bpiconsulting.com> wrote in message
    news:QLmLf.2804$5M6.1223@newsread2.news.atl.earthlink.net...
    > I have a chart embedded on a worksheet. I would like to select the cell
    > just below the chart. Is there a way of finding that location?
    >
    > Thanks,
    >
    > Bill
    >
    >




  3. #3
    Peter T
    Guest

    Re: Location of Cell Between Embedded Chart

    Tim & Bill

    I didn't see the OP but simply

    Dim rng As Range
    With ActiveSheet.ChartObjects(1)
    Set rng = ActiveSheet.Cells(.BottomRightCell.Row + 1, _
    .TopLeftCell.Column)
    End With

    rng.Select

    Regards,
    Peter T


    "Tim Barlow" <tim@doctim.co.uk> wrote in message
    news:eQul5IlOGHA.1088@tk2msftngp13.phx.gbl...
    > Bill,
    >
    > AFAIK, there is no easy lookup - you have to work it out:
    >
    > 1. Determine the position of the chart and its height on the sheet:
    >
    > Dim baseline as Double
    > With ActiveSheet.ChartObjects("Chart 1")
    > baseline = .Top + .Height
    > End With
    >
    > 2. Add together the heights of all the rows until the sum is greater than
    > the baseline above:
    >
    > Dim aRow As Long
    > Dim cumRowHt As Double
    >
    > Do
    > aRow = aRow + 1
    > cumRowHt = cumRowHt + Rows(aRow).RowHeight
    > Loop Until cumRowHt > baseline
    > Cells(aRow + 1, 2) = "Put text Here"
    >
    >
    > You can do something similar with the left & width properties to determine
    > which column.
    >
    > HTH
    >
    > Tim
    >
    >
    >
    > "Bill" <bill@bpiconsulting.com> wrote in message
    > news:QLmLf.2804$5M6.1223@newsread2.news.atl.earthlink.net...
    > > I have a chart embedded on a worksheet. I would like to select the cell
    > > just below the chart. Is there a way of finding that location?
    > >
    > > Thanks,
    > >
    > > Bill
    > >
    > >

    >
    >




  4. #4
    Tim Barlow
    Guest

    Re: Location of Cell Between Embedded Chart

    Peter,

    That's much neater & quicker.

    Tim


    "Peter T" <peter_t@discussions> wrote in message
    news:eU1ipwlOGHA.3732@TK2MSFTNGP10.phx.gbl...
    > Tim & Bill
    >
    > I didn't see the OP but simply
    >
    > Dim rng As Range
    > With ActiveSheet.ChartObjects(1)
    > Set rng = ActiveSheet.Cells(.BottomRightCell.Row + 1, _
    > .TopLeftCell.Column)
    > End With
    >
    > rng.Select
    >
    > Regards,
    > Peter T
    >
    >
    > "Tim Barlow" <tim@doctim.co.uk> wrote in message
    > news:eQul5IlOGHA.1088@tk2msftngp13.phx.gbl...
    > > Bill,
    > >
    > > AFAIK, there is no easy lookup - you have to work it out:
    > >
    > > 1. Determine the position of the chart and its height on the sheet:
    > >
    > > Dim baseline as Double
    > > With ActiveSheet.ChartObjects("Chart 1")
    > > baseline = .Top + .Height
    > > End With
    > >
    > > 2. Add together the heights of all the rows until the sum is greater

    than
    > > the baseline above:
    > >
    > > Dim aRow As Long
    > > Dim cumRowHt As Double
    > >
    > > Do
    > > aRow = aRow + 1
    > > cumRowHt = cumRowHt + Rows(aRow).RowHeight
    > > Loop Until cumRowHt > baseline
    > > Cells(aRow + 1, 2) = "Put text Here"
    > >
    > >
    > > You can do something similar with the left & width properties to

    determine
    > > which column.
    > >
    > > HTH
    > >
    > > Tim
    > >
    > >
    > >
    > > "Bill" <bill@bpiconsulting.com> wrote in message
    > > news:QLmLf.2804$5M6.1223@newsread2.news.atl.earthlink.net...
    > > > I have a chart embedded on a worksheet. I would like to select the

    cell
    > > > just below the chart. Is there a way of finding that location?
    > > >
    > > > Thanks,
    > > >
    > > > Bill
    > > >
    > > >

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1