![]() |
#5
|
||||
|
||||
![]() Quote:
Code:
Sub Test() Dim xlApp As Object, xlbook As Object, LastRow As Long Const xlpart = 2 Const xlbyrows = 1 Const xlprevious = 2 Const xlformulas = 5 Set xlApp = CreateObject("Excel.Application") Set xlbook = xlApp.workbooks.Add xlbook.Sheets(1).Range("A1").PasteSpecial With xlbook.Sheets(1) If xlApp.WorksheetFunction.CountA(.Cells) <> 0 Then LastRow = .Cells.Find(What:="*", _ After:=.Range("A1"), _ Lookat:=xlpart, _ LookIn:=xlformulas, _ SearchOrder:=xlbyrows, _ SearchDirection:=xlprevious, _ MatchCase:=False).Row Else LastRow = 1 End If End With MsgBox LastRow End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word to Excel Links Stop Working | DAC8190 | Word | 1 | 10-08-2015 05:56 PM |
Controlling Widows (single-word lines at the end of a paragraph) | downtownbooks | Word | 2 | 12-09-2014 03:57 PM |
![]() |
judyn | Office | 9 | 04-23-2013 05:10 AM |
Controlling search option in word | suvvi | Word | 0 | 08-05-2011 06:10 AM |
![]() |
radman154 | Word Tables | 1 | 03-25-2011 12:04 AM |