Trying to Avoid Selecting Sheets

  • Thread starter Thread starter Kevin O'Neill
  • Start date Start date
K

Kevin O'Neill

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top