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

Received this code want to idenify empty cells and return to sheet if
vbyes/no yes. I am missing something because it goes on and runs code instead
of returning to worksheet for completion. Not sure what to add.
Thanks

Dim Blanks As VbMsgBoxResult
Dim LastRow As Long
Dim myR As Range

With Worksheets("MailD")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
On Error GoTo NoBlanks
Set myR = .Range("A2:F2").Resize(LastRow -
4).SpecialCells(xlCellTypeBlanks)
Blanks = MsgBox("Do you want to complete blanks?", vbYesNo)
If Blanks = vbYes Then
myR.Select
End If
NoBlanks:
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Trapping blanks


Maybe this...
If Blanks = vbYes Then
myR.Select
End If

Should be...
If Blanks = vbYes Then
myR.Select
Exit Sub
End If
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Curt"
wrote in message
Received this code want to idenify empty cells and return to sheet if
vbyes/no yes. I am missing something because it goes on and runs code instead
of returning to worksheet for completion. Not sure what to add.
Thanks

Dim Blanks As VbMsgBoxResult
Dim LastRow As Long
Dim myR As Range
With Worksheets("MailD")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
On Error GoTo NoBlanks
Set myR = .Range("A2:F2").Resize(LastRow -
4).SpecialCells(xlCellTypeBlanks)
Blanks = MsgBox("Do you want to complete blanks?", vbYesNo)
If Blanks = vbYes Then
myR.Select
End If
NoBlanks:
End With
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Trapping blanks

Jim:
Thanks much
cagreer Springfield Oregon
"Jim Cone" wrote:


Maybe this...
If Blanks = vbYes Then
myR.Select
End If

Should be...
If Blanks = vbYes Then
myR.Select
Exit Sub
End If
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Curt"
wrote in message
Received this code want to idenify empty cells and return to sheet if
vbyes/no yes. I am missing something because it goes on and runs code instead
of returning to worksheet for completion. Not sure what to add.
Thanks

Dim Blanks As VbMsgBoxResult
Dim LastRow As Long
Dim myR As Range
With Worksheets("MailD")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
On Error GoTo NoBlanks
Set myR = .Range("A2:F2").Resize(LastRow -
4).SpecialCells(xlCellTypeBlanks)
Blanks = MsgBox("Do you want to complete blanks?", vbYesNo)
If Blanks = vbYes Then
myR.Select
End If
NoBlanks:
End With

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Trapping blanks

Made the change and all I need to do now is hide userform. Was makeing
change in wrong place. first time around.
Thanks for input.


"Jim Cone" wrote:


Maybe this...
If Blanks = vbYes Then
myR.Select
End If

Should be...
If Blanks = vbYes Then
myR.Select
Exit Sub
End If
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Curt"
wrote in message
Received this code want to idenify empty cells and return to sheet if
vbyes/no yes. I am missing something because it goes on and runs code instead
of returning to worksheet for completion. Not sure what to add.
Thanks

Dim Blanks As VbMsgBoxResult
Dim LastRow As Long
Dim myR As Range
With Worksheets("MailD")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
On Error GoTo NoBlanks
Set myR = .Range("A2:F2").Resize(LastRow -
4).SpecialCells(xlCellTypeBlanks)
Blanks = MsgBox("Do you want to complete blanks?", vbYesNo)
If Blanks = vbYes Then
myR.Select
End If
NoBlanks:
End With

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
How to count blanks and spaces that look like blanks Ben Excel Programming 1 July 10th 07 06:34 PM
Sumproduct copying blanks or how to insert zero into blanks asg2307 Excel Worksheet Functions 4 April 4th 07 07:26 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Programming 5 September 3rd 06 11:23 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
Paste Special Skip Blanks not skipping blanks, but overwriting... gsrosin Excel Discussion (Misc queries) 0 February 22nd 05 03:33 AM


All times are GMT +1. The time now is 10:31 PM.

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

About Us

"It's about Microsoft Excel"