+ Reply to Thread
Results 1 to 3 of 3

Trying to Avoid Selecting Sheets

  1. #1
    Kevin O'Neill
    Guest

    Trying to Avoid Selecting Sheets

    Variables are Curr1 and Curr2

    This code is in a module, which is run threw a button on Sheet14, I
    need to get the variables assigned from Sheet 12 and use them in
    Sheet14. This works fine as it is, but as the amatuer I am (first proj.
    in vba) I know your suppose to avoid selecting anything, except I don't
    know how to do it.

    So the code is correct, I'm just tyring to use it without the Select
    command, because I believe it is slowing me down. It takes 16 secs to
    create a 20x1400 table.

    Suggestions?

    -----------------------------------------------------------

    Sheet12.Select
    Cells(8, 41).Select

    Do
    If IsEmpty(ActiveCell) = False Then
    ActiveCell.Offset(1, 0).Select
    End If
    Loop Until IsEmpty(ActiveCell) = True

    Do
    If IsEmpty(ActiveCell) = True Then
    ActiveCell.Offset(1, 0).Select
    End If
    Loop Until IsEmpty(ActiveCell) = False

    Dim curr1 'Shear Starting Point Row
    curr1 = ActiveCell.Row

    Do
    If IsEmpty(ActiveCell) = False Then
    ActiveCell.Offset(1, 0).Select
    End If
    Loop Until IsEmpty(ActiveCell) = True

    Do
    If IsEmpty(ActiveCell) = True Then
    ActiveCell.Offset(1, 0).Select
    End If
    Loop Until IsEmpty(ActiveCell) = False

    Dim curr2 'Deflection Starting Point Row
    curr2 = ActiveCell.Row
    Sheet14.Select


  2. #2
    Tom Ogilvy
    Guest

    Re: Trying to Avoid Selecting Sheets

    Sub SetRows()
    With Sheet12
    curr1 = .Cells(8, 2).End(xlDown).End(xlDown).Row
    curr2 = .Cells(curr1, 2).End(xlDown).End(xlDown).Row
    End With
    End Sub

    --
    Regards,
    Tom Ogilvy

    "Kevin O'Neill" <[email protected]> wrote in message
    news:[email protected]...
    > Variables are Curr1 and Curr2
    >
    > This code is in a module, which is run threw a button on Sheet14, I
    > need to get the variables assigned from Sheet 12 and use them in
    > Sheet14. This works fine as it is, but as the amatuer I am (first proj.
    > in vba) I know your suppose to avoid selecting anything, except I don't
    > know how to do it.
    >
    > So the code is correct, I'm just tyring to use it without the Select
    > command, because I believe it is slowing me down. It takes 16 secs to
    > create a 20x1400 table.
    >
    > Suggestions?
    >
    > -----------------------------------------------------------
    >
    > Sheet12.Select
    > Cells(8, 41).Select
    >
    > Do
    > If IsEmpty(ActiveCell) = False Then
    > ActiveCell.Offset(1, 0).Select
    > End If
    > Loop Until IsEmpty(ActiveCell) = True
    >
    > Do
    > If IsEmpty(ActiveCell) = True Then
    > ActiveCell.Offset(1, 0).Select
    > End If
    > Loop Until IsEmpty(ActiveCell) = False
    >
    > Dim curr1 'Shear Starting Point Row
    > curr1 = ActiveCell.Row
    >
    > Do
    > If IsEmpty(ActiveCell) = False Then
    > ActiveCell.Offset(1, 0).Select
    > End If
    > Loop Until IsEmpty(ActiveCell) = True
    >
    > Do
    > If IsEmpty(ActiveCell) = True Then
    > ActiveCell.Offset(1, 0).Select
    > End If
    > Loop Until IsEmpty(ActiveCell) = False
    >
    > Dim curr2 'Deflection Starting Point Row
    > curr2 = ActiveCell.Row
    > Sheet14.Select
    >




  3. #3
    Kevin O'Neill
    Guest

    Re: Trying to Avoid Selecting Sheets

    That's pretty amazing looking, thanks.


+ 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