Hello Last two rows can be deleted like this: '/ fun / last 2 rows in column A Sub LastRow () Range ("A" & Rows.Count). End (xlUp). Offset (-1). Resize (2,1). EntireRow.Delete End Sub As I understand UP, A: H always be braided in a row, so we can test whether the cell in row A is merged. Sub DeleteMergedCells () Dim FirstRow As Long Dim LastRow As Long Dim TargetRng As Range Dim DeleteRng As Range Dim cell As Range FirstRow = 1 'First row we will examine LastRow = Range ("A" & Rows.Count). End (xlUp) . Row 'Test Area Set TargetRng = Range ("A" & FirstRow, Range ("A" & LastRow)) For Each cell In TargetRng If cell.MergeCells fun = True Then If DeleteRng Is Nothing Then Set DeleteRng = cell Else Set DeleteRng = Union (DeleteRng, cell) End If End If Next 'Delete rows if found rows with merged cells If Not DeleteRng Is Nothing Then DeleteRng.EntireRow.Delete End If End Sub Sincerely, Pat "Jorgen Bondesen" wrote in message news : 4d85ee82 $ 0 $ 23756 $ [email protected] .. Hello Kurt and January Jan's macro assumes that there are over 65536 rows. Therefore, the following may be an alternative. Option Explicit '/ / last row in column A Sub LastRow () Range ("A" & Rows.Count). End (xlUp). EntireRow.Delete End Sub' / / last row Sub Lastrow2 () ActiveSheet.UsedRange Range (" A "& ActiveCell.SpecialCells (xlLastCell). Row). EntireRow.Delete End Sub - Best regards Jørgen Bondesen the" Jan Kron Sell "<[email protected]> wrote in message news: 4d85e43f $ 0 $ 36566 $ [email protected]. . >>> "Kurt Smith" <[email protected]> wrote in message> news: [email protected] .. >> I have data in 8 columns and x number of rows. Where there was >> page breaks in the original report, fun there are now a number where the 8 >> cells are intertwined. Some of them contain text, others not. >>>> How do I delete these rows in one blow? I would like to be able >> click me back and possibly. record a macro. Not that I will not >> be ungrateful for a ready hand-written macro, but I would >> like to learn how to use Excel without long study of VBA. >>>> In the same vein: How do I delete the last (or the last two) >> row (s), regardless of how many rows are in the sheet? >> fun - >> Sincerely, Kurt Hansen >>> fun Neither of you can probably achieve with a recorded macro. When you> record the macro, you can say that it is always some specific rows, eg> 1:3 to be deleted, or you can say that it's rows with a particular> offset from the row you are in, When you run the macro. > But if the rows to be deleted, for example, always the bottom rows or> row that satisfies a particular property, but which are not the same place every> fun time, you have to program yourself out of it. >> This code deletes the bottom row where there is data in akolonnen: >> Sub Makro1 ()> Range ("a65536"). End (xlUp). EntireRow.Delete> End Sub >> The second macro requires more information about the rows to be deleted. January >>
You might också interested in disse Notice of forbidden characters in the cell alert forbidden characters in the cell alert forbidden characters in the cell alert forbidden characters in the cell [OpenOffice] Retrieve a field from another worksheet [OpenOffice] Retrieve a field from another Spreadsheet [OpenOffice] Retrieve a field from another worksheet Thick line under several thick line under several thick line under row
Archives January 2010 December 2009 November 2009 October 2009 September 2009 Recent Bookmarks Data Sheet Adobe CS5 newport Fox News Shock Video Music Video Product catalog Washing Machine fundraiser
Privacy Policy | About | TOS | Request removal of content | Grepler.com 2011
No comments:
Post a Comment