Copy and paste from multiple worksheets to another (combine results into a table)

Bamerand

Board Regular
Joined
Jan 11, 2013
Messages
62
<!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves/> <w:TrackFormatting/> <w:PunctuationKerning/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-GB</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:EnableOpenTypeKerning/> <w:DontFlipMirrorIndents/> <w:OverrideTableStyleHps/> </w:Compatibility> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="--"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} table.MsoTableGrid {mso-style-name:"Table Grid"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-priority:59; mso-style-unhide:no; border:solid windowtext 1.0pt; mso-border-alt:solid windowtext .5pt; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-border-insideh:.5pt solid windowtext; mso-border-insidev:.5pt solid windowtext; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-fareast-language:EN-US;} </style> <![endif]--> [FONT=&quot]Dear all,[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]I need some help in writing a code for the following:[/FONT]
[FONT=&quot]I have a workbook with 11 worksheets in it. Each worksheet has a unique name (such as 167L, 167S, 170S, 170L, 173S, 173L, 175A, 183S, 183L and etc.). Each of the worksheet is updated daily and I need to extract data from specific columns and according to specific time.[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]A[/FONT]
[FONT=&quot]B[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]D[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]F[/FONT]
[FONT=&quot]G[/FONT]
[FONT=&quot]H[/FONT]
[FONT=&quot]I[/FONT]
[FONT=&quot]173L[/FONT]
[FONT=&quot]DATE[/FONT]
[FONT=&quot]TIME[/FONT]
[FONT=&quot]W[/FONT]
[FONT=&quot]DS[/FONT]
[FONT=&quot]WH[/FONT]
[FONT=&quot]S[/FONT]
[FONT=&quot]WC[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]bars[/FONT]
[FONT=&quot]bars[/FONT]
[FONT=&quot]C0[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]0/64"[/FONT]
[FONT=&quot]27.10.13[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]95[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]02:00[/FONT]
[FONT=&quot]91[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:00[/FONT]
[FONT=&quot]89[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]06:00[/FONT]
[FONT=&quot]93[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]16[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]08:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]95[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]16[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]3[/FONT][FONT=&quot][/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]10:00[/FONT]
[FONT=&quot]90[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]16[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]12[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]12:00[/FONT]
[FONT=&quot]89[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]14[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]16[/FONT][FONT=&quot][/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]14:00[/FONT]
[FONT=&quot]92[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]14[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]5[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]16:00[/FONT]
[FONT=&quot]95[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]15[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]7[/FONT][FONT=&quot][/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]18:00[/FONT]
[FONT=&quot]92[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]14[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]8[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]20:00[/FONT]
[FONT=&quot]93[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]14[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]12[/FONT][FONT=&quot][/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]22:00[/FONT]
[FONT=&quot]90[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]14[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]6[/FONT]
[FONT=&quot]24/64"[/FONT]
[FONT=&quot]28.10.13[/FONT]
[FONT=&quot]00:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]98[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]14[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]24/64"[/FONT]

<tbody>
</tbody>
[FONT=&quot] [/FONT]
[FONT=&quot]Basically, the code I have used before I was assisted by the www.mrexcel.com/forum before, however, I need to have it devised in a bit different way (pls visit the www….. for details). The code I need should (a) select values at column “B” (the corresponding values are 04:00, 08:00, 12:00, 16:00, 20:00 and 00:00), copy value in column “G” (0, 0, 0, 0, 0, 0) and sum up with values from column “H”, which before being added should be divided by a factor of “2” (0/2=0, 3/2=1.5, 16/2=8, 7/2=3.5, 12/2=6, 0/2=0). The summed values should be copied and pasted into a separate worksheet and it needs to look like this:[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:00[/FONT]
[FONT=&quot]08:00[/FONT]
[FONT=&quot]12:00[/FONT]
[FONT=&quot]16:00[/FONT]
[FONT=&quot]20:00[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]173L[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]1.5[/FONT]
[FONT=&quot]8[/FONT]
[FONT=&quot]3.5[/FONT]
[FONT=&quot]6[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]

<tbody>
</tbody>
[FONT=&quot]The things get a bit complicated as different worksheet in a workbook have slightly different table compare with the one in above. [/FONT]
[FONT=&quot]A[/FONT]
[FONT=&quot]B[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]D[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]F[/FONT]
[FONT=&quot]G[/FONT]
[FONT=&quot]H[/FONT]
[FONT=&quot]183L[/FONT]
[FONT=&quot]DATE[/FONT]
[FONT=&quot]TIME[/FONT]
[FONT=&quot]W[/FONT]
[FONT=&quot]DS[/FONT]
[FONT=&quot]WH[/FONT]
[FONT=&quot]S[/FONT]
[FONT=&quot]WC[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]bars[/FONT]
[FONT=&quot]bars[/FONT]
[FONT=&quot]C0[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]0/64"[/FONT]
[FONT=&quot]27.10.13[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]30[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]3[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]02:00[/FONT]
[FONT=&quot]34[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:00[/FONT]
[FONT=&quot]38[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]1[/FONT][FONT=&quot][/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]06:00[/FONT]
[FONT=&quot]38[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]08:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]37[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]15[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]10:00[/FONT]
[FONT=&quot]36[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]15[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]12:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]31[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]15[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0.5[/FONT][FONT=&quot][/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]14:00[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]15[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]16:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]25[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]15[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]18:00[/FONT]
[FONT=&quot]21[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]4[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]20:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]33[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]17[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]2[/FONT][FONT=&quot][/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]22:00[/FONT]
[FONT=&quot]35[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]20/64"[/FONT]
[FONT=&quot]28.10.13[/FONT]
[FONT=&quot]00:00[/FONT][FONT=&quot][/FONT]
[FONT=&quot]35[/FONT]
[FONT=&quot]11.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0[/FONT][FONT=&quot][/FONT]
[FONT=&quot]20/64"[/FONT]

<tbody>
</tbody>
[FONT=&quot] [/FONT]
[FONT=&quot]So, the final output from two worksheets should look like:[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:00[/FONT]
[FONT=&quot]08:00[/FONT]
[FONT=&quot]12:00[/FONT]
[FONT=&quot]16:00[/FONT]
[FONT=&quot]20:00[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]173L[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]1.5[/FONT]
[FONT=&quot]8[/FONT]
[FONT=&quot]3.5[/FONT]
[FONT=&quot]6[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]183L[/FONT]
[FONT=&quot]1[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]0.5[/FONT]
[FONT=&quot]0[/FONT]
[FONT=&quot]2[/FONT]
[FONT=&quot]1[/FONT]

<tbody>
</tbody>
[FONT=&quot] [/FONT]
[FONT=&quot]And finally, to make things more complicated, the monitoring hours vary, like in the table below:[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]A[/FONT]
[FONT=&quot]B[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot]D[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]F[/FONT]
[FONT=&quot]G[/FONT]
[FONT=&quot]H[/FONT]
[FONT=&quot]I[/FONT]
[FONT=&quot]175A[/FONT][FONT=&quot][/FONT]
[FONT=&quot]DATE[/FONT]
[FONT=&quot]TIME[/FONT]
[FONT=&quot]W[/FONT]
[FONT=&quot]DS[/FONT]
[FONT=&quot]WH[/FONT]
[FONT=&quot]S[/FONT]
[FONT=&quot]WC[/FONT]
[FONT=&quot]E[/FONT]
[FONT=&quot]C[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]bar[/FONT]
[FONT=&quot]bar[/FONT]
[FONT=&quot]Co[/FONT]
[FONT=&quot]22/64"[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]%[/FONT]
[FONT=&quot]27.10.13[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]31[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]00:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]32[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]01:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]37[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]01:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]02:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]39[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]02:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]03:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]36[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]03:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]33[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]35[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]38[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]05:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]05:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]37[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]06:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]33[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]06:30[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]20[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]36[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]07:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]27[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]08:00[/FONT]
[FONT=&quot]40.5[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]29[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]09:00[/FONT]
[FONT=&quot]40.5[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]35[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]10:00[/FONT]
[FONT=&quot]40.5[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]26[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]11:00[/FONT]
[FONT=&quot]40.5[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]29[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]12:00[/FONT]
[FONT=&quot]40.5[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]32[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]13:00[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]31[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]14:00[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]28[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]15:00[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]42[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]16:00[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]36[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]17:00[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]27[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]18:00[/FONT]
[FONT=&quot]41[/FONT]
[FONT=&quot]10[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]32[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]19:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]36[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]20:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]31[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]21:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]34[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]22:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]29[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]23:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]33[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]
[FONT=&quot]28.10.13[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]40[/FONT]
[FONT=&quot]9.5[/FONT]
[FONT=&quot]18[/FONT]
[FONT=&quot]16/64"[/FONT]
[FONT=&quot]31[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]trace[/FONT]

<tbody>
</tbody>
[FONT=&quot] [/FONT]
[FONT=&quot]With this worksheet (175A), my final output should look like this:[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]04:00[/FONT]
[FONT=&quot]08:00[/FONT]
[FONT=&quot]12:00[/FONT]
[FONT=&quot]16:00[/FONT]
[FONT=&quot]20:00[/FONT]
[FONT=&quot]00:00[/FONT]
[FONT=&quot]173L[/FONT]
[FONT=&quot]0[/FONT]​
[FONT=&quot]1.5[/FONT]​
[FONT=&quot]8[/FONT]​
[FONT=&quot]3.5[/FONT]​
[FONT=&quot]6[/FONT]​
[FONT=&quot]0[/FONT]​
[FONT=&quot]183L[/FONT]
[FONT=&quot]1[/FONT]​
[FONT=&quot]0[/FONT]​
[FONT=&quot]0.5[/FONT]​
[FONT=&quot]0[/FONT]​
[FONT=&quot]2[/FONT]​
[FONT=&quot]1[/FONT]​
[FONT=&quot]175A[/FONT]
[FONT=&quot]35[/FONT]​
[FONT=&quot]29[/FONT]​
[FONT=&quot]32[/FONT]​
[FONT=&quot]36[/FONT]​
[FONT=&quot]31[/FONT]​
[FONT=&quot]31[/FONT]​

<tbody>
</tbody>
[FONT=&quot] [/FONT]
[FONT=&quot]Since there are no value at column “H”, divided by a factor of “2” is skipped.[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]Here is a code I used before, and it executes part of the required job:[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]Dim myrow As Long[/FONT]
[FONT=&quot]Dim wksTo As Worksheet[/FONT]
[FONT=&quot]Dim j, s As Long[/FONT]
[FONT=&quot]Dim lastRow, lastsheet As Long[/FONT]
[FONT=&quot]Dim wks As Worksheet[/FONT]
[FONT=&quot]Dim sn As String[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] Sheets(1).Select[/FONT]
[FONT=&quot] Sheets.Add.Name = "wksTo"[/FONT]
[FONT=&quot] lastRow = 2 ' set the first row to use, set to 2 so you can add labels in row 1[/FONT]
[FONT=&quot] lastsheet = Sheets.Count[/FONT]
[FONT=&quot] For s = 2 To lastsheet ' Loop thru sheets[/FONT]
[FONT=&quot] Worksheets(s).Activate[/FONT]
[FONT=&quot] With Worksheets(s) ' sheet(s) changes sheets[/FONT]
[FONT=&quot] On Error Resume Next[/FONT]
[FONT=&quot] myrow = .Columns("A").Find(Date).Row[/FONT]
[FONT=&quot] Application.Goto .Range("A" & myrow), True[/FONT]
[FONT=&quot] End With[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] With Worksheets(s)[/FONT]
[FONT=&quot] ActiveCell.Offset(rowoffset:=0, columnoffset:=1).Activate[/FONT]
[FONT=&quot] End With[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] With Application.ActiveWindow.ActiveCell[/FONT]
[FONT=&quot] dc = 0[/FONT]
[FONT=&quot] sn = Sheets(s).Name[/FONT]
[FONT=&quot] Worksheets("wksTo").Range("G" & lastRow).Formula = sn[/FONT]
[FONT=&quot] For j = 1 To -10 Step -2[/FONT]
[FONT=&quot] Range(.Cells(j, 6), .Cells(j, 6)).Copy Sheets("wksTo").Cells(lastRow, 8 - dc)[/FONT]
[FONT=&quot] dc = dc + 1[/FONT]
[FONT=&quot] Next j[/FONT]
[FONT=&quot] lastRow = lastRow + 1[/FONT]
[FONT=&quot] End With[/FONT]
[FONT=&quot] Next s[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] Dim x As Integer[/FONT]
[FONT=&quot] Worksheets("wksTo").Activate[/FONT]
[FONT=&quot] For x = 1 To Worksheets.Count[/FONT]
[FONT=&quot] Cells(x, 1).Value = Worksheets(x).Name[/FONT]
[FONT=&quot] Next x[/FONT]
Dear all,

I need some help in writing a code for the following:
I have a workbook with 11 worksheets in it. Each worksheet has a unique name (such as 167L, 167S, 170S, 170L, 173S, 173L, 175A, 183S, 183L and etc.). Each of the worksheet is updated daily and I need to extract data from specific columns and according to specific time.

A
B
C
D
E
F
G
H
I
173L
DATE
TIME
W
DS
WH
S
WC
E
C
bars
bars
C0
%
%
%
0/64"
27.10.13
00:00
95
28
18
0
0
0
24/64"

02:00
91
28
18
0
0
2
24/64"

04:00
89
28
17
0
0
0
24/64"

06:00
93
28
16
0
0
1
24/64"

08:00
95
28
16
0
0
3
24/64"

10:00
90
28
16
0
0
12
24/64"

12:00
89
28
14
0
0
16
24/64"

14:00
92
28
14
0
0
5
24/64"

16:00
95
28
15
0
0
7
24/64"

18:00
92
28
14
0
0
8
24/64"

20:00
93
28
14
0
0
12
24/64"

22:00
90
28
14
0
0
6
24/64"
28.10.13
00:00
98
28
14
0
0
0
24/64"

<tbody>
</tbody>

Basically, the code I have used before I was assisted by the www.mrexcel.com/forum before, however, I need to have it devised in a bit different way (pls visit the www….. for details). The code I need should (a) select values at column “B” (the corresponding values are 04:00, 08:00, 12:00, 16:00, 20:00 and 00:00), copy value in column “G” (0, 0, 0, 0, 0, 0) and sum up with values from column “H”, which before being added should be divided by a factor of “2” (0/2=0, 3/2=1.5, 16/2=8, 7/2=3.5, 12/2=6, 0/2=0). The summed values should be copied and pasted into a separate worksheet and it needs to look like this:


04:00
08:00
12:00
16:00
20:00
00:00
173L
0
1.5
8
3.5
6
0








<tbody>
</tbody>
The things get a bit complicated as different worksheet in a workbook have slightly different table compare with the one in above.
A
B
C
D
E
F
G
H
183L
DATE
TIME
W
DS
WH
S
WC
C
bars
bars
C0
%
%
0/64"
27.10.13
00:00
30
11.5
17
0
3
20/64"

02:00
34
11.5
17
0
1
20/64"

04:00
38
11.5
17
0
1
20/64"

06:00
38
11.5
17
0
2
20/64"

08:00
37
11.5
15
0
0
20/64"

10:00
36
11.5
15
0
0
20/64"

12:00
31
11.5
15
0
0.5
20/64"

14:00
28
11.5
15
0
0
20/64"

16:00
25
11.5
15
0
0
20/64"

18:00
21
11.5
17
0
4
20/64"

20:00
33
11.5
17
0
2
20/64"

22:00
35
11.5
18
0
1
20/64"
28.10.13
00:00
35
11.5
18
0
0
20/64"

<tbody>
</tbody>

So, the final output from two worksheets should look like:


04:00
08:00
12:00
16:00
20:00
00:00
173L
0
1.5
8
3.5
6
0
183L
1
0
0.5
0
2
1

<tbody>
</tbody>

And finally, to make things more complicated, the monitoring hours vary, like in the table below:

A
B
C
D
E
F
G
H
I
175A
DATE
TIME
W
DS
WH
S
WC
E
C


bar
bar
Co
22/64"
%
%
%
27.10.13
00:00
40
9
20
16/64"
31

trace

00:30
40
9
20
16/64"
32

trace

01:00
40
9
20
16/64"
37

trace

01:30
40
9
20
16/64"
40

trace

02:00
40
9
20
16/64"
39

trace

02:30
40
9
20
16/64"
41

trace

03:00
40
9
20
16/64"
36

trace

03:30
40
9
20
16/64"
33

trace

04:00
40
9
20
16/64"
35

trace

04:30
40
9
20
16/64"
38

trace

05:00
40
9
20
16/64"
40

trace

05:30
40
9
20
16/64"
37

trace

06:00
40
9
20
16/64"
33

trace

06:30
40
9
20
16/64"
36

trace

07:00
40
9
18
16/64"
27

trace

08:00
40.5
10
18
16/64"
29

trace

09:00
40.5
10
18
16/64"
35

trace

10:00
40.5
10
18
16/64"
26

trace

11:00
40.5
10
18
16/64"
29

trace

12:00
40.5
10
18
16/64"
32

trace

13:00
41
10
18
16/64"
31

trace

14:00
41
10
18
16/64"
28

trace

15:00
41
10
18
16/64"
42

trace

16:00
41
10
18
16/64"
36

trace

17:00
41
10
18
16/64"
27

trace

18:00
41
10
18
16/64"
32

trace

19:00
40
9.5
18
16/64"
36

trace

20:00
40
9.5
18
16/64"
31

trace

21:00
40
9.5
18
16/64"
34

trace

22:00
40
9.5
18
16/64"
29

trace

23:00
40
9.5
18
16/64"
33

trace
28.10.13
00:00
40
9.5
18
16/64"
31

trace

<tbody>
</tbody>

With this worksheet (175A), my final output should look like this:

04:00
08:00
12:00
16:00
20:00
00:00
173L
0
1.5
8
3.5
6
0
183L
1
0
0.5
0
2
1
175A
35
29
32
36
31
31

<tbody>
</tbody>

Since there are no value at column “H”, divided by a factor of “2” is skipped.

Here is a code I used before, and it executes part of the required job:

Dim myrow As Long
Dim wksTo As Worksheet
Dim j, s As Long
Dim lastRow, lastsheet As Long
Dim wks As Worksheet
Dim sn As String

Sheets(1).Select
Sheets.Add.Name = "wksTo"
lastRow = 2 ' set the first row to use, set to 2 so you can add labels in row 1
lastsheet = Sheets.Count
For s = 2 To lastsheet ' Loop thru sheets
Worksheets(s).Activate
With Worksheets(s) ' sheet(s) changes sheets
On Error Resume Next
myrow = .Columns("A").Find(Date).Row
Application.Goto .Range("A" & myrow), True
End With

With Worksheets(s)
ActiveCell.Offset(rowoffset:=0, columnoffset:=1).Activate
End With

With Application.ActiveWindow.ActiveCell
dc = 0
sn = Sheets(s).Name
Worksheets("wksTo").Range("G" & lastRow).Formula = sn
For j = 1 To -10 Step -2
Range(.Cells(j, 6), .Cells(j, 6)).Copy Sheets("wksTo").Cells(lastRow, 8 - dc)
dc = dc + 1
Next j
lastRow = lastRow + 1
End With
Next s

Dim x As Integer
Worksheets("wksTo").Activate
For x = 1 To Worksheets.Count
Cells(x, 1).Value = Worksheets(x).Name
Next x
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,215,652
Messages
6,126,033
Members
449,281
Latest member
redwine77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top