ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find and clearcontent (https://www.excelbanter.com/excel-programming/302595-re-find-clearcontent.html)

Dave Peterson[_3_]

Find and clearcontent
 
maybe???

Option Explicit
Sub testme()

Dim FoundCell As Range

With ActiveSheet
Set FoundCell = .Cells.Find(what:="end of report", _
after:=.Cells(.Cells.Count), LookIn:=xlValues, _
lookat:=xlWhole, searchorder:=xlByRows, _
searchdirection:=xlNext, MatchCase:=False)
If FoundCell Is Nothing Then
'do nothing
Else
.Range(FoundCell, .Cells(.Rows.Count, "A")).EntireRow.ClearContents
End If

End With

End Sub

xl-end-database means row 65536?????




Rui wrote:

Hi,

I´m trying to clearcontent from my imported database the rows from "End of Report" cell to "xl-end-database".

i've done the finding "End of Report" cell (cell.find( ... )) but can´t put it in a range to the end of database to clear. i thought of make it a variable, but still no results!

(excel xp)


--

Dave Peterson



All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com