Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting Focus in Cells via Macros (Escel 2000)

    Hello,

    I'm developing a macro and need some assistance with the VB code. The macro is designed for an Excel workbook with two worksheets.

    The first worksheet contains a matrix of approximately 60 columns x 300 rows of data. The macro performs a series of analyses, comparing the contents of every column to the contents of every other column in the matrix.

    A summary of each column-to-column analysis is then built in 9 cells in a row of the first worksheet. I want to paste each of these 9-cell summaries into the second worksheet, with each new analysis in the row following the previous 9-cell summary.

    The macro appears to be doing the analyses correctly, and is building and formatting the 9-cell summary as designed.

    I need assistance with the VB statements to:

    1. Change focus to the second worksheet (which seems to work with the statement I have now.)
    2. Set focus in the

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting Focus in Cells via Macros (Escel 2000)

    First, a general comment. It is almost never necessary to select a range of cells to work with it, and doing so is always much slower.

    Without seeing your worksheets or other code, I will try to come as close to what you want to do as I can. The code below was not tested since I don't have your worksheets or code.

    <pre>Dim lLastRow As Long
    With Worksheets("Summary")
    lLastRow = Range("A1").Offset(.UsedRange.Row + .UsedRange.Rows.Count, 0).End(xlUp).Row
    .Paste Destination:=.Range("A1").Offset(lLastRow, 0)
    End With
    </pre>

    Legare Coleman

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting Focus in Cells via Macros (Escel 2000)

    Legare,

    Your statements did the trick! Thank you very much for the assist!

    John Lincoln

Posting Permissions

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