Shloime
Board Regular
- Joined
- Oct 25, 2023
- Messages
- 60
- Office Version
- 365
- 2021
- 2019
- 2016
- Platform
- Windows
I'm using VBA code to fill data into a sheet that already contains data, so I need to find the first blank row.
these are the 2 methods use, I prefer the first because it checks all columns, The issue with both is, when i have a filter on the target sheet it will find the last visible cell the same as when i click ctrl + arrow up in the worksheet +1 will be a row hidden by the filter and the code would over write the data there.
Does anyone have a solution to handle this, or a different method to find the first blank row?
these are the 2 methods use, I prefer the first because it checks all columns, The issue with both is, when i have a filter on the target sheet it will find the last visible cell the same as when i click ctrl + arrow up in the worksheet +1 will be a row hidden by the filter and the code would over write the data there.
Does anyone have a solution to handle this, or a different method to find the first blank row?
VBA Code:
Debug.Print Sheets("Sheet1").Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False, SearchFormat:=False).Row + 1
Debug.Print Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row + 1