Monday, 15 April 2013

excel - Using copyRange with formatting equaling xlPasteValuesAndNumberFormats -


I am VBA very innovative for the world and mostly taught myself (this is also the result of most of my issues) I 'Autofilter Some codes have been collected to copy the data from the new sheet to the results. The problem I am doing is the format in which this goal is being copied to the sheet - I want it to have the same format without using the actual copy / paste " XlPasteValuesAndNumberFormats "to copy in this format - Is there a way to achieve this goal? I prefer not to use copy / paste because the sample code is repeated several times with filter criteria and goes to give memory error. The sample code is very good and there is no memory problem with the exception of formatting. Any help, suggestion, stroking the ego (j / k) appreciated

PS:. I do not mean the filter criteria, but I had to remove the original criteria due to my confidential nature - sorry

  sub-MWSB_Filter_Macro () the reduced src worksheet as TGT dim Set the worksheet dim filterRange range as the slow copyRange range last Row, set src = ActiveWorkbook.Sheets ("Named Log Sheets") set to TGT = ActiveWorkbook .Sheets ("Named Target Sheet") src.AutoFilterMode = false lastRow = Src.Range ('A' in & amp; src.Rows.Count) .End (xlUp) .Row set filterRange = src.Range ("A5:" as Cop FilterRange.AutoFilter field: = 5, criterion1: = "MWSB" filterRange.AutoFilter field: = 12, criterion1: = "2-set for criteria" 2 ", operator: = xlOr, Criteria2: =" 3-criteria for 3 "filterRange.AutoFilter field: = 28, Criteria1: =" "filterRange.AutoFilter field: = 35, Criteria1: =" "copyRange.SpecialCells ( XlCellTypeVisible) .copy tgt.Range ("A1")  

I'm feeling this It's like you "gathering a pop-up message in between the run-time, telling something full clipboard. "If this is true, you can avoid any pop-up messages that occur during the run-time (and therefore you use the per / paste method mentioned) by putting the following at the top of your process: / P>

  Application. Display Eltar = Incorrect  

Alternatively you can copy to the destination, as it is above, the code to go to that destination Add and change the format for range (mac Cry attempt to record you do not know how to use VBA).

Michael


No comments:

Post a Comment