Row Spacing Between Command Button

diamond

New Member
Joined
Apr 5, 2002
Messages
21
I have searched this site but I didn't find the answer to this question.

I have created Command Button to bring me down to rows then other buttons to bring me back to the top of the page. I have a file with over 1200 rows.

My problem is that I need to add rows in between the buttons but every things change. I need a way to set a cell for the button and it would be floating. It wouldn't matter how many rows I insert in between then.

Here is an example of what I have done.

Private Sub CommandButton1_Click()
Range("A900").Select
End Sub


Private Sub CommandButton2_Click()
Range("A3").Select
End Sub

I have many schools, a buttom bring me at the beginning of the school rows then at the end a buttom bring me back up.

Thanks for your help, I'm a beginner.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Zack Barresse

MrExcel MVP
Joined
Dec 9, 2003
Messages
10,881
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
  3. Web
Hello Denis,

if you want to find the first open cell in a column, use:

Sub findLast()
Range("C1").Select
ActiveCell.End(xlDown).Offset(1, 0).Select
End Sub

and in the great words of Just Jon:
If column C has holes in it, and you wish to append data below the last used cell as opposed to starting with the 1st unused cell, you can use --
Dim LastRow as Long
...
LastRow=[C65536].End(3).Row + 1
' Cells(LastRow, 3) will reference the column C cell
...

HTH
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,882
Messages
5,766,896
Members
425,383
Latest member
IllDo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top