Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default using macro to copy and paste filtered results, what if blank?

I have a sheet with 500 lines that are filtered for late deliveries, when
there are no late deliveries my macro can not paste to another sheet blank
results. How do I get round this problem?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,939
Default using macro to copy and paste filtered results, what if blank?

Post your code so we can see what you are up to...
--
HTH...

Jim Thomlinson


"priceyindevon" wrote:

I have a sheet with 500 lines that are filtered for late deliveries, when
there are no late deliveries my macro can not paste to another sheet blank
results. How do I get round this problem?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default using macro to copy and paste filtered results, what if blank?

Hi,
The sheet is auto filtered for each day with the sub totals on line 502. But
if there are nil results (no lates) the macro below will not paste the nil
return. It states cannot change part of a merged cell!

Column B is the time
Column D is the name of delivery
Column G is the amount of product being delivered.

The results are then pasted to another worksheet to list late suppliers.

Sub sunlateam()
'
' sunlateam Macro
' Macro recorded 11/12/2006 by Mark Price
'

'
Sheets("Sun").Select
Application.Run "openall"
Application.Run "lateam"
Range("D11:D501").Select
Selection.Copy
Sheets("Suppliers").Select
Range("A6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = True
.ReadingOrder = xlContext
.MergeCells = False
End With
Sheets("Sun").Select
Range("B11:B501").Select
Selection.Copy
Sheets("Suppliers").Select
Range("B6").Select
ActiveSheet.Paste
Sheets("Sun").Select
Range("G11:G501").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Suppliers").Select
Range("C6").Select
ActiveSheet.Paste
Range("A6:C55").Select
Application.CutCopyMode = False
Selection.FormatConditions.Delete
Selection.Interior.ColorIndex = xlNone
Selection.Font.ColorIndex = 0
Selection.Font.Bold = True
Selection.Font.Bold = False
Range("A6:A55").Select
ActiveCell.SpecialCells(xlCellTypeSameValidation). Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop,
Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Range("A1").Select
End Sub

"Jim Thomlinson" wrote:

Post your code so we can see what you are up to...
--
HTH...

Jim Thomlinson


"priceyindevon" wrote:

I have a sheet with 500 lines that are filtered for late deliveries, when
there are no late deliveries my macro can not paste to another sheet blank
results. How do I get round this problem?

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
HELP with macro for copy and paste RedOctagon Excel Discussion (Misc queries) 0 October 13th 06 02:54 PM
Macro copy and paste = blank worksheet efface Excel Discussion (Misc queries) 1 April 27th 06 09:52 PM
Macro to find, copy, and paste until value change Valerie Excel Worksheet Functions 4 January 26th 06 04:10 AM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Macro to open workbook and copy and paste values in to orig workbo Dena X Excel Worksheet Functions 1 December 15th 05 11:13 PM


All times are GMT +1. The time now is 07:28 AM.

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"