Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default xlup to find last row

Have the following macro. Need to add xlup to find last row so dont highlite
blank rows not in use. Not sure how to add to this?
Thanks All

Worksheets("Data").Activate
Range("d5:m100").Select
Selection.specialcells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
Userform1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default xlup to find last row

Worksheets("Data").Activate
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("D5:M5").Resize(LastRow - 4).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
UserForm1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Curt" wrote in message
...
Have the following macro. Need to add xlup to find last row so dont
highlite
blank rows not in use. Not sure how to add to this?
Thanks All

Worksheets("Data").Activate
Range("d5:m100").Select
Selection.specialcells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
Userform1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default xlup to find last row

compiles fine when run get error object variable or with block variable not
set yellows LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Know there is a setting I am missing
used all settings I can think of so am lost
Thanks Again

"Bob Phillips" wrote:

Worksheets("Data").Activate
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("D5:M5").Resize(LastRow - 4).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
UserForm1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Curt" wrote in message
...
Have the following macro. Need to add xlup to find last row so dont
highlite
blank rows not in use. Not sure how to add to this?
Thanks All

Worksheets("Data").Activate
Range("d5:m100").Select
Selection.specialcells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
Userform1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default xlup to find last row

My last post Thanks Bob got it working fine guess cryed wolf to soon. Thanks
much for your input

"Bob Phillips" wrote:

Worksheets("Data").Activate
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("D5:M5").Resize(LastRow - 4).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
UserForm1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Curt" wrote in message
...
Have the following macro. Need to add xlup to find last row so dont
highlite
blank rows not in use. Not sure how to add to this?
Thanks All

Worksheets("Data").Activate
Range("d5:m100").Select
Selection.specialcells(xlCellTypeBlanks).Select
Selection.ClearContents
Dim blanks As Long
blanks = MsgBox(prompt:="Do you have blanks to complete?",
Buttons:=vbYesNo)
If blanks = vbYes Then
UserForm4.Hide
Userform1.Hide
Exit Sub
If blanks = vbNo Then
End If
Exit Sub
End If




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding .End(xlUp) (1,1) Dennis Excel Discussion (Misc queries) 4 April 4th 23 02:13 PM
End(xlUp) question CoolBusiness Excel Discussion (Misc queries) 4 March 26th 09 07:07 PM
problem with .end(xlUp).row [email protected] Excel Discussion (Misc queries) 4 December 29th 06 01:24 PM
End(xlUp) m4nd4li4 Excel Programming 3 March 15th 05 07:57 PM
XLUP FInd Error Todd Huttenstine Excel Programming 3 August 12th 04 07:52 AM


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"