first found blank cell to activecell address

Vans666

New Member
Joined
Jul 29, 2017
Messages
7
any help please.
After finding a blank cell using code below i would like to make that blank cell the active cell.
I know that you cannot assign a constant to a an active cell address therefore the below line of code fails


Public Sub findcell()


ActiveCell.Address = Worksheets("sheet1").Range("e4").End(xlDown).Row + 1


MsgBox "the active cell is " & ActiveCell.Address


End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Something like this?
Code:
Sub findcell()
  Application.Goto Reference:=Worksheets("sheet1").Range("e4").End(xlDown).Offset(1), Scroll:=True
End Sub
 
Upvote 0
any help please.
After finding a blank cell using code below i would like to make that blank cell the active cell.
I know that you cannot assign a constant to a an active cell address therefore the below line of code fails


Public Sub findcell()


ActiveCell.Address = Worksheets("sheet1").Range("e4").End(xlDown).Row + 1


MsgBox "the active cell is " & ActiveCell.Address


End Sub
You have to Select or Activate a cell in order to make it the ActiveCell. Try replacing the highlighted line of code above with this...

Worksheets("sheet1").Range("e4").End(xlDown).Offset(1).Select
 
Upvote 0
Try replacing the highlighted line of code above with this...

Worksheets("sheet1").Range("e4").End(xlDown).Offset(1).Select
Just a comment:
If 'Sheet1' is not the active sheet, that code will error, if 'Sheet1' will be the active sheet then the blue bit is redundant (it would also be redundant in my code if 'Sheet1' is going to be the active sheet).
 
Last edited:
Upvote 0
Just a comment:
If 'Sheet1' is not the active sheet, that code will error, if 'Sheet1' will be the active sheet then the blue bit is redundant.
Good point (that's what I get for copy/pasting without thinking:banghead:). Just to clarify for the OP... you cannot select a cell or range of cells (nor activate a single cell) on any sheet other than the active sheet.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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