 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Copy Data from an entire row in Excel 2003 Sheet to another sheet in the same workbook automatically</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2013 03:14:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: manibhai</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-105227</link>
		<dc:creator>manibhai</dc:creator>
		<pubDate>Thu, 22 Mar 2012 05:15:02 +0000</pubDate>
		<guid isPermaLink="false">#comment-105227</guid>
		<description><![CDATA[I Could n&#039;t understand the question can you elabrote this.]]></description>
		<content:encoded><![CDATA[<p>I Could n&#8217;t understand the question can you elabrote this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimsnyder</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-88699</link>
		<dc:creator>jimsnyder</dc:creator>
		<pubDate>Fri, 25 Feb 2011 18:24:34 +0000</pubDate>
		<guid isPermaLink="false">#comment-88699</guid>
		<description><![CDATA[I am working on the same problem from a different angle. I am using rows ferom a master sheet and placing them in individual sheets as rows appended to the bottom. I am working on the final syntax of finding the first emopty row at the bottom of the individual spreadsheets, but you can convert the code to handle months easily:

Sub MoveDataToSheets()
&#039;
&#039; MoveDataToSheets Macro
&#039; Macro written 2/25/2011 by Jim Snyder
&#039;
    Dim rowCount As Integer, sheetIndex As Integer
    Dim LastRow As Range
        
    &#039; Prevent screen updates from slowing execution
    Application.ScreenUpdating = False
    
    rowCount = ActiveCell.CurrentRegion.Rows.Count
    
    &#039; Process each row once copying row to matching location tab
    For currentRow = 1 To rowCount
    
        &#039; Determine which sheet the row goes to
        Select Case (Cells(currentRow, &quot;B&quot;).Value)
            Case &quot;ALTAVISTA&quot;
                sheetIndex = 2
            Case &quot;AN&quot;
                sheetIndex = 3
            Case &quot;Ballytivnan&quot;
                sheetIndex = 4
            Case &quot;Casa Grande&quot;
                sheetIndex = 5
            Case &quot;Columbus - Devices (DE)&quot;
                sheetIndex = 6
            Case &quot;Columbus - Nutrition&quot;
                sheetIndex = 7
            Case &quot;Fairfield&quot;
                sheetIndex = 8
            Case &quot;Granada&quot;
                sheetIndex = 9
            Case &quot;Guangzhou&quot;
                sheetIndex = 10
            Case &quot;NOLA&quot;
                sheetIndex = 11
            Case &quot;Process Research Operations (PRO)&quot;
                sheetIndex = 12
            Case &quot;Richmond&quot;
                sheetIndex = 13
            Case &quot;Singapore&quot;
                sheetIndex = 14
            Case &quot;Sturgis&quot;
                sheetIndex = 15
            Case &quot;Zwolle&quot;
                sheetIndex = 16
            Case Else
                sheetIndex = 1
        End Select
        
        &#039; Only if the row cotains a valid location, copy it to location sheet
        If (sheetIndex &gt; 1) Then
            Set sheet = Worksheets(sheetIndex)    &#039; Designate target sheet
            ActiveSheet.Rows(currentRow).Copy     &#039; Copy from master sheet
            sheet.Activate
            
            sheet.Paste Destination:=.Cells(LastRow, 1) &#039; Paste in location specific sheet
        End If
    Next

    Application.ScreenUpdating = True
End Sub]]></description>
		<content:encoded><![CDATA[<p>I am working on the same problem from a different angle. I am using rows ferom a master sheet and placing them in individual sheets as rows appended to the bottom. I am working on the final syntax of finding the first emopty row at the bottom of the individual spreadsheets, but you can convert the code to handle months easily:</p>
<p>Sub MoveDataToSheets()<br />
&#8216;<br />
&#8216; MoveDataToSheets Macro<br />
&#8216; Macro written 2/25/2011 by Jim Snyder<br />
&#8216;<br />
    Dim rowCount As Integer, sheetIndex As Integer<br />
    Dim LastRow As Range</p>
<p>    &#8216; Prevent screen updates from slowing execution<br />
    Application.ScreenUpdating = False</p>
<p>    rowCount = ActiveCell.CurrentRegion.Rows.Count</p>
<p>    &#8216; Process each row once copying row to matching location tab<br />
    For currentRow = 1 To rowCount</p>
<p>        &#8216; Determine which sheet the row goes to<br />
        Select Case (Cells(currentRow, &#8220;B&#8221;).Value)<br />
            Case &#8220;ALTAVISTA&#8221;<br />
                sheetIndex = 2<br />
            Case &#8220;AN&#8221;<br />
                sheetIndex = 3<br />
            Case &#8220;Ballytivnan&#8221;<br />
                sheetIndex = 4<br />
            Case &#8220;Casa Grande&#8221;<br />
                sheetIndex = 5<br />
            Case &#8220;Columbus &#8211; Devices (DE)&#8221;<br />
                sheetIndex = 6<br />
            Case &#8220;Columbus &#8211; Nutrition&#8221;<br />
                sheetIndex = 7<br />
            Case &#8220;Fairfield&#8221;<br />
                sheetIndex = 8<br />
            Case &#8220;Granada&#8221;<br />
                sheetIndex = 9<br />
            Case &#8220;Guangzhou&#8221;<br />
                sheetIndex = 10<br />
            Case &#8220;NOLA&#8221;<br />
                sheetIndex = 11<br />
            Case &#8220;Process Research Operations (PRO)&#8221;<br />
                sheetIndex = 12<br />
            Case &#8220;Richmond&#8221;<br />
                sheetIndex = 13<br />
            Case &#8220;Singapore&#8221;<br />
                sheetIndex = 14<br />
            Case &#8220;Sturgis&#8221;<br />
                sheetIndex = 15<br />
            Case &#8220;Zwolle&#8221;<br />
                sheetIndex = 16<br />
            Case Else<br />
                sheetIndex = 1<br />
        End Select</p>
<p>        &#8216; Only if the row cotains a valid location, copy it to location sheet<br />
        If (sheetIndex &gt; 1) Then<br />
            Set sheet = Worksheets(sheetIndex)    &#8216; Designate target sheet<br />
            ActiveSheet.Rows(currentRow).Copy     &#8216; Copy from master sheet<br />
            sheet.Activate</p>
<p>            sheet.Paste Destination:=.Cells(LastRow, 1) &#8216; Paste in location specific sheet<br />
        End If<br />
    Next</p>
<p>    Application.ScreenUpdating = True<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbelectric</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-67012</link>
		<dc:creator>sbelectric</dc:creator>
		<pubDate>Mon, 17 Aug 2009 01:55:34 +0000</pubDate>
		<guid isPermaLink="false">#comment-67012</guid>
		<description><![CDATA[Dgrainge:
Good analysis and suggested solution.  But still I do not understand the following:
1)  Worksheets(“Mar”).Cells(k3, 1) = Worksheets(“YTD”).Cells(I, 1)   works to get the cell value
2)  But  Worksheets(“Mar”). Rows(k3) = Worksheets(“YTD”).Rows(I) – does not work to get row values

What is the easy way to get the entire row values copied from one Worksheet to another Worksheet?   Or say copy 1st 9 columns  (A thru I) of Row 3  from one worksheet to another?

Will be looking forward to your answer.  Have a great day!]]></description>
		<content:encoded><![CDATA[<p>Dgrainge:<br />
Good analysis and suggested solution.  But still I do not understand the following:<br />
1)  Worksheets(“Mar”).Cells(k3, 1) = Worksheets(“YTD”).Cells(I, 1)   works to get the cell value<br />
2)  But  Worksheets(“Mar”). Rows(k3) = Worksheets(“YTD”).Rows(I) – does not work to get row values</p>
<p>What is the easy way to get the entire row values copied from one Worksheet to another Worksheet?   Or say copy 1st 9 columns  (A thru I) of Row 3  from one worksheet to another?</p>
<p>Will be looking forward to your answer.  Have a great day!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dgrainge</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-66842</link>
		<dc:creator>dgrainge</dc:creator>
		<pubDate>Wed, 12 Aug 2009 16:34:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-66842</guid>
		<description><![CDATA[&gt;Just for experiment, when I tried Worksheets(”Jan”).Rows(k1) = 123.45 - 
&gt; it populated the entire Row with 123.45. Go figure!!!

Rows(k1) - you have selected one complete row.  In VBA,  Range = value causes all cells in that range to be be set to that value

Worksheet(&quot;JAN&quot;).Range(&quot;A1:B10&quot;) = 99 will set 20 cells to value 99

Worksheet(&quot;JAN&quot;).Range(&quot;A:K&quot;) = 99 will set all cells in 11 rows to 99]]></description>
		<content:encoded><![CDATA[<p>&gt;Just for experiment, when I tried Worksheets(”Jan”).Rows(k1) = 123.45 &#8211;<br />
&gt; it populated the entire Row with 123.45. Go figure!!!</p>
<p>Rows(k1) &#8211; you have selected one complete row.  In VBA,  Range = value causes all cells in that range to be be set to that value</p>
<p>Worksheet(&#8220;JAN&#8221;).Range(&#8220;A1:B10&#8243;) = 99 will set 20 cells to value 99</p>
<p>Worksheet(&#8220;JAN&#8221;).Range(&#8220;A:K&#8221;) = 99 will set all cells in 11 rows to 99</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dgrainge</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-66840</link>
		<dc:creator>dgrainge</dc:creator>
		<pubDate>Wed, 12 Aug 2009 16:24:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-66840</guid>
		<description><![CDATA[I don&#039;t think there&#039;s a simple way to do this completely automatically.

If you were simply using Excel without VBA, I&#039;d suggest a manual solution using Advanced filter and copy / paste.

Let&#039;s assume it&#039;s permisible to add a colum to your source data table.  I have created a month column =MONTH(c2) which yields 1 .. 12.   THis makes it much easier to select the data required.  You can hide that column if you don&#039;t want people messing with it.

Giving:

code	name1	date	name2	thing	number	code3	yes	code4	name3	month
11-11111	Couch	27/02/2007	Jones	ARSON	Arson	II	YES	OSFM	Coos	2
11-55555	Stern	27/01/2009	Smith	PEC	Arson	II	YES	OSFM	Joe	1
10-12345	Leon	15/01/2009	Stella	ARSON	Arson	II	YES	OSFM	Cooper	1
11-00025	Couch	27/02/2009	Jones	ARSON	Arson	II	YES	OSFM	Coos	2
11-00025	Lee	03/03/2009	Johns	MEC	Arson	II	YES	OSFM	Ruth	3

(please excuse the messy copy/paste from Excel.  You&#039;ll also notice I&#039;ve given each column a unique header name. Necessary for what follows)

I have also added, at cell A10,

month
2

because I want to find Feb entries

I then applied Advanced filtering, but I also recorded it as a macro

    Range(&quot;A1&quot;).Select
    Range(&quot;A1:K6&quot;).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range _
        (&quot;A10:A11&quot;), Unique:=False
    Selection.CurrentRegion.Select
    Selection.Copy
    Sheets(&quot;FEB&quot;).Select
    Range(&quot;A1&quot;).Select
    ActiveSheet.Paste
    Sheets(&quot;SHEET1&quot;).Select
    ActiveSheet.ShowAllData


This selected the table of data at A1, selected Month=2 as criteria, and then filtered just the Feb data.

I then selected the table (and got just the visible part), copied it and pasted it to the FEB sheet.

Then I returned the table to its previous unfiltered condition.

I now have 2 rows of data in the FEB sheet, and the column headings at the top.

How about other Months?  cell A11 contains 2, hence we look up month 2.  SHEETS(&quot;FEB&quot;) needs to be changed as well.

You could copy/paste this code 11 more times, or you could use a for/next loop.  Not only would you have to put the month number into cell A11, you&#039;d have to turn the month number into a name

for i =  1 to 12
    Range(&quot;A11&quot;).Select
    ActiveCell.FormulaR1C1 = i
...
...
    Sheets(Text(i, &quot;MMM&quot;)).Select
...
...
Next i

Actually Text(i,&quot;MMM&quot;) won&#039;t work because the first parameter is treated a a date if using MMM format, and 1 isn&#039;t a date!


For i = 1 To 12
    Range(&quot;A11&quot;).Select
    ActiveCell.FormulaR1C1 = i
    Range(&quot;A1&quot;).Select
    Range(&quot;A1:K6&quot;).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range(&quot;A10:A11&quot;), Unique:=False
    Selection.SpecialCells(xlCellTypeVisible).Select
    Selection.CurrentRegion.Select
    Selection.Copy
    txtSheet = UCase(Application.WorksheetFunction.Text(DateSerial(1990, i, 1), &quot;MMM&quot;))
    Sheets(txtSheet).Select
    Range(&quot;A1&quot;).Select
    ActiveSheet.Paste
    Sheets(&quot;SHEET1&quot;).Select
    ActiveSheet.ShowAllData
Next i

This doesn&#039;t remove OLD text from the month cheets, it simply pastes in the new stuff.  If you skip to each sheet, select the active region round A1 and then delete, you&#039;ll clear the decks  - and that means a few lines of code extra before pasting the filtered data.

If you are careful to place formulae so there is always going to be blank space between the table and the summary, you won;t over-write your monthly formulae.

To tidy up:

You could extend this code

1. the macro puts codes down column I (month) and removed them afterwards
2. The macro sets both cells A10 ands A11 and removes them afterwards

Plainly A10 and A11 aren&#039;t appropriate places for these 2 cells to go, in practice.

3. You could use the control toolbox to add a button to the front sheet - and the code I&#039;ve given you becomes the code for the button activation.

Derek]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t think there&#8217;s a simple way to do this completely automatically.</p>
<p>If you were simply using Excel without VBA, I&#8217;d suggest a manual solution using Advanced filter and copy / paste.</p>
<p>Let&#8217;s assume it&#8217;s permisible to add a colum to your source data table.  I have created a month column =MONTH(c2) which yields 1 .. 12.   THis makes it much easier to select the data required.  You can hide that column if you don&#8217;t want people messing with it.</p>
<p>Giving:</p>
<p>code	name1	date	name2	thing	number	code3	yes	code4	name3	month<br />
11-11111	Couch	27/02/2007	Jones	ARSON	Arson	II	YES	OSFM	Coos	2<br />
11-55555	Stern	27/01/2009	Smith	PEC	Arson	II	YES	OSFM	Joe	1<br />
10-12345	Leon	15/01/2009	Stella	ARSON	Arson	II	YES	OSFM	Cooper	1<br />
11-00025	Couch	27/02/2009	Jones	ARSON	Arson	II	YES	OSFM	Coos	2<br />
11-00025	Lee	03/03/2009	Johns	MEC	Arson	II	YES	OSFM	Ruth	3</p>
<p>(please excuse the messy copy/paste from Excel.  You&#8217;ll also notice I&#8217;ve given each column a unique header name. Necessary for what follows)</p>
<p>I have also added, at cell A10,</p>
<p>month<br />
2</p>
<p>because I want to find Feb entries</p>
<p>I then applied Advanced filtering, but I also recorded it as a macro</p>
<p>    Range(&#8220;A1&#8243;).Select<br />
    Range(&#8220;A1:K6&#8243;).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range _<br />
        (&#8220;A10:A11&#8243;), Unique:=False<br />
    Selection.CurrentRegion.Select<br />
    Selection.Copy<br />
    Sheets(&#8220;FEB&#8221;).Select<br />
    Range(&#8220;A1&#8243;).Select<br />
    ActiveSheet.Paste<br />
    Sheets(&#8220;SHEET1&#8243;).Select<br />
    ActiveSheet.ShowAllData</p>
<p>This selected the table of data at A1, selected Month=2 as criteria, and then filtered just the Feb data.</p>
<p>I then selected the table (and got just the visible part), copied it and pasted it to the FEB sheet.</p>
<p>Then I returned the table to its previous unfiltered condition.</p>
<p>I now have 2 rows of data in the FEB sheet, and the column headings at the top.</p>
<p>How about other Months?  cell A11 contains 2, hence we look up month 2.  SHEETS(&#8220;FEB&#8221;) needs to be changed as well.</p>
<p>You could copy/paste this code 11 more times, or you could use a for/next loop.  Not only would you have to put the month number into cell A11, you&#8217;d have to turn the month number into a name</p>
<p>for i =  1 to 12<br />
    Range(&#8220;A11&#8243;).Select<br />
    ActiveCell.FormulaR1C1 = i<br />
&#8230;<br />
&#8230;<br />
    Sheets(Text(i, &#8220;MMM&#8221;)).Select<br />
&#8230;<br />
&#8230;<br />
Next i</p>
<p>Actually Text(i,&#8221;MMM&#8221;) won&#8217;t work because the first parameter is treated a a date if using MMM format, and 1 isn&#8217;t a date!</p>
<p>For i = 1 To 12<br />
    Range(&#8220;A11&#8243;).Select<br />
    ActiveCell.FormulaR1C1 = i<br />
    Range(&#8220;A1&#8243;).Select<br />
    Range(&#8220;A1:K6&#8243;).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range(&#8220;A10:A11&#8243;), Unique:=False<br />
    Selection.SpecialCells(xlCellTypeVisible).Select<br />
    Selection.CurrentRegion.Select<br />
    Selection.Copy<br />
    txtSheet = UCase(Application.WorksheetFunction.Text(DateSerial(1990, i, 1), &#8220;MMM&#8221;))<br />
    Sheets(txtSheet).Select<br />
    Range(&#8220;A1&#8243;).Select<br />
    ActiveSheet.Paste<br />
    Sheets(&#8220;SHEET1&#8243;).Select<br />
    ActiveSheet.ShowAllData<br />
Next i</p>
<p>This doesn&#8217;t remove OLD text from the month cheets, it simply pastes in the new stuff.  If you skip to each sheet, select the active region round A1 and then delete, you&#8217;ll clear the decks  &#8211; and that means a few lines of code extra before pasting the filtered data.</p>
<p>If you are careful to place formulae so there is always going to be blank space between the table and the summary, you won;t over-write your monthly formulae.</p>
<p>To tidy up:</p>
<p>You could extend this code</p>
<p>1. the macro puts codes down column I (month) and removed them afterwards<br />
2. The macro sets both cells A10 ands A11 and removes them afterwards</p>
<p>Plainly A10 and A11 aren&#8217;t appropriate places for these 2 cells to go, in practice.</p>
<p>3. You could use the control toolbox to add a button to the front sheet &#8211; and the code I&#8217;ve given you becomes the code for the button activation.</p>
<p>Derek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbelectric</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-64551</link>
		<dc:creator>sbelectric</dc:creator>
		<pubDate>Thu, 18 Jun 2009 20:10:38 +0000</pubDate>
		<guid isPermaLink="false">#comment-64551</guid>
		<description><![CDATA[May be Sarfaraz Ahmed
&lt;a href=&quot;http://findsarfaraz.blogspot.com&quot;&gt;MS Excel help&lt;/a&gt;
may be able to tell me how to copy the Row data in one statement (or define 9 columns as one entity) and then copy.
Thanks, Ahmed.
sbElectric]]></description>
		<content:encoded><![CDATA[<p>May be Sarfaraz Ahmed<br />
<a href="http://findsarfaraz.blogspot.com">MS Excel help</a><br />
may be able to tell me how to copy the Row data in one statement (or define 9 columns as one entity) and then copy.<br />
Thanks, Ahmed.<br />
sbElectric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbelectric</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-64500</link>
		<dc:creator>sbelectric</dc:creator>
		<pubDate>Wed, 17 Jun 2009 03:27:38 +0000</pubDate>
		<guid isPermaLink="false">#comment-64500</guid>
		<description><![CDATA[David, thank you for your nice comments.  I am glad to know that you followed my very simplified logic!!!
Yes, that is exactly what I was trying to do as you suggested.  But could not define the nine columns (A to I) as one entity.  I need to  lookup how Range is used in plain VB.   I do not use Macro – may need to learn it also. What surprised and frustrated me is that the statement 
If Cells(I,11) = 1 Then
Worksheets(&quot;Jan&quot;).Rows(k1) = Worksheets(&quot;YTD&quot;).Rows(I)  - did not work.
It did not give any compile error or any error message.  But did not copy the data.

Just for experiment,   when I tried  Worksheets(&quot;Jan&quot;).Rows(k1) = 123.45   -  it populated the entire  Row with 123.45.     Go figure!!!]]></description>
		<content:encoded><![CDATA[<p>David, thank you for your nice comments.  I am glad to know that you followed my very simplified logic!!!<br />
Yes, that is exactly what I was trying to do as you suggested.  But could not define the nine columns (A to I) as one entity.  I need to  lookup how Range is used in plain VB.   I do not use Macro – may need to learn it also. What surprised and frustrated me is that the statement<br />
If Cells(I,11) = 1 Then<br />
Worksheets(&#8220;Jan&#8221;).Rows(k1) = Worksheets(&#8220;YTD&#8221;).Rows(I)  &#8211; did not work.<br />
It did not give any compile error or any error message.  But did not copy the data.</p>
<p>Just for experiment,   when I tried  Worksheets(&#8220;Jan&#8221;).Rows(k1) = 123.45   &#8211;  it populated the entire  Row with 123.45.     Go figure!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chippy088</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-64492</link>
		<dc:creator>chippy088</dc:creator>
		<pubDate>Tue, 16 Jun 2009 18:12:02 +0000</pubDate>
		<guid isPermaLink="false">#comment-64492</guid>
		<description><![CDATA[nice solution sbElectric.

Have you thought about using the range function?

instead of

If Cells(I, 11) = 1 Then
Worksheets(”Jan”).Cells(k1, 1) = Worksheets(”YTD”).Cells(I, 1)
Worksheets(”Jan”).Cells(k1, 2) = Worksheets(”YTD”).Cells(I, 2)
Worksheets(”Jan”).Cells(k1, 3) = Worksheets(”YTD”).Cells(I, 3)

try 

If Cells(I, 11) = 1 Then          ; check cell value
Range(&quot;A2:l2&quot;).Select           ; or however many cells from the row you want to copy
    Selection.Copy
Sheets(&quot;Jan&quot;).Select             ; or whichever sheet you need to copy to
    Range(&quot;A2&quot;).Select            ; change for the target row
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False

try to do the transfer by creating a macro, this will give you a list of the functions used (and their syntax) which you can use as a starting point.

the hard part is going to be doing the comparison to decide which sheet the row needs to be copied to.

I use macros a lot. they are after all a subset of Visual basic (Visual basic for Applications ..VBA)

Alt-F8 create macro

Copy the data, then just refine it to do the checks.
Dave]]></description>
		<content:encoded><![CDATA[<p>nice solution sbElectric.</p>
<p>Have you thought about using the range function?</p>
<p>instead of</p>
<p>If Cells(I, 11) = 1 Then<br />
Worksheets(”Jan”).Cells(k1, 1) = Worksheets(”YTD”).Cells(I, 1)<br />
Worksheets(”Jan”).Cells(k1, 2) = Worksheets(”YTD”).Cells(I, 2)<br />
Worksheets(”Jan”).Cells(k1, 3) = Worksheets(”YTD”).Cells(I, 3)</p>
<p>try </p>
<p>If Cells(I, 11) = 1 Then          ; check cell value<br />
Range(&#8220;A2:l2&#8243;).Select           ; or however many cells from the row you want to copy<br />
    Selection.Copy<br />
Sheets(&#8220;Jan&#8221;).Select             ; or whichever sheet you need to copy to<br />
    Range(&#8220;A2&#8243;).Select            ; change for the target row<br />
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _<br />
        False, Transpose:=False</p>
<p>try to do the transfer by creating a macro, this will give you a list of the functions used (and their syntax) which you can use as a starting point.</p>
<p>the hard part is going to be doing the comparison to decide which sheet the row needs to be copied to.</p>
<p>I use macros a lot. they are after all a subset of Visual basic (Visual basic for Applications ..VBA)</p>
<p>Alt-F8 create macro</p>
<p>Copy the data, then just refine it to do the checks.<br />
Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sbelectric</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-64468</link>
		<dc:creator>sbelectric</dc:creator>
		<pubDate>Mon, 15 Jun 2009 19:54:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-64468</guid>
		<description><![CDATA[Ok, Wiggetssis – I spent last night to solve your problem of copying data on various worksheets.  And I tested  - it works!  I have saved it as Excel 2003 so it should work for you (I have Excel 2007). 
Examining your test data I assumed the data contains in 9 columns (Col A thru I) starting with Row 2.  Row 1 may have header information.   On K2  enter =Month(C2).  Now click on lower handle on K2 and drag it all the way to end of data row.  This will populate the Month number based on Col C date information.
Now create the additional 12 worksheets – Jan thru Dec on the same spreadsheet.
The VB code to copy the data will be as follows:
Sub CopyRows()
k1 = 1
k2 = 1
k3 = 1
k4 = 1
K5 = 1
K6 = 1
K7 = 1
K8 = 1
k9 = 1
K10 = 1
K11 = 1
k12 = 1

For I = 2 To 500
  If Cells(I, 11) = 1 Then
       Worksheets(&quot;Jan&quot;).Cells(k1, 1) = Worksheets(&quot;YTD&quot;).Cells(I, 1)
       Worksheets(&quot;Jan&quot;).Cells(k1, 2) = Worksheets(&quot;YTD&quot;).Cells(I, 2)
       Worksheets(&quot;Jan&quot;).Cells(k1, 3) = Worksheets(&quot;YTD&quot;).Cells(I, 3)
       Worksheets(&quot;Jan&quot;).Cells(k1, 4) = Worksheets(&quot;YTD&quot;).Cells(I, 4)
       Worksheets(&quot;Jan&quot;).Cells(k1, 5) = Worksheets(&quot;YTD&quot;).Cells(I, 5)
       Worksheets(&quot;Jan&quot;).Cells(k1, 6) = Worksheets(&quot;YTD&quot;).Cells(I, 6)
       Worksheets(&quot;Jan&quot;).Cells(k1, 7) = Worksheets(&quot;YTD&quot;).Cells(I, 7)
       Worksheets(&quot;Jan&quot;).Cells(k1, 8) = Worksheets(&quot;YTD&quot;).Cells(I, 8)
       Worksheets(&quot;Jan&quot;).Cells(k1, 9) = Worksheets(&quot;YTD&quot;).Cells(I, 9)
       k1 = k1 + 1
    ElseIf Cells(I, 11) = 2 Then
       Worksheets(&quot;Feb&quot;).Cells(k2, 1) = Worksheets(&quot;YTD&quot;).Cells(I, 1)
       Worksheets(&quot;Feb&quot;).Cells(k2, 2) = Worksheets(&quot;YTD&quot;).Cells(I, 2)
       Worksheets(&quot;Feb&quot;).Cells(k2, 3) = Worksheets(&quot;YTD&quot;).Cells(I, 3)
       Worksheets(&quot;Feb&quot;).Cells(k2, 4) = Worksheets(&quot;YTD&quot;).Cells(I, 4)
       Worksheets(&quot;Feb&quot;).Cells(k2, 5) = Worksheets(&quot;YTD&quot;).Cells(I, 5)
       Worksheets(&quot;Feb&quot;).Cells(k2, 6) = Worksheets(&quot;YTD&quot;).Cells(I, 6)
       Worksheets(&quot;Feb&quot;).Cells(k2, 7) = Worksheets(&quot;YTD&quot;).Cells(I, 7)
       Worksheets(&quot;Feb&quot;).Cells(k2, 8) = Worksheets(&quot;YTD&quot;).Cells(I, 8)
       Worksheets(&quot;Feb&quot;).Cells(k2, 9) = Worksheets(&quot;YTD&quot;).Cells(I, 9)
       k2 = k2 + 1
    ElseIf Cells(I, 11) = 3 Then
       Worksheets(&quot;Mar&quot;).Cells(k3,1) = Worksheets(&quot;YTD&quot;).Cells(I,1)
            Etc.
       k3 = k3 + 1
    ElseIf Cells(I, 11) = 4 Then
       Worksheets(&quot;Apr&quot;).Cells(K4,1)  = Worksheets(&quot;YTD&quot;).Cells(I,1)
          Etc…..
       k4 = k4 + 1
             Etc   …. ETC
    ElseIf Cells(I, 11) = 12 Then
       Worksheets(&quot;Dec&quot;).Cells(k12, 1) = Worksheets(&quot;YTD&quot;).Cells(I, 1)
       Worksheets(&quot;Dec&quot;).Cells(k12, 2) = Worksheets(&quot;YTD&quot;).Cells(I, 2)
       Worksheets(&quot;Dec&quot;).Cells(k12, 3) = Worksheets(&quot;YTD&quot;).Cells(I, 3)
       Worksheets(&quot;Dec&quot;).Cells(k12, 4) = Worksheets(&quot;YTD&quot;).Cells(I, 4)
       Worksheets(&quot;Dec&quot;).Cells(k12, 5) = Worksheets(&quot;YTD&quot;).Cells(I, 5)
       Worksheets(&quot;Dec&quot;).Cells(k12, 6) = Worksheets(&quot;YTD&quot;).Cells(I, 6)
       Worksheets(&quot;Dec&quot;).Cells(k12, 7) = Worksheets(&quot;YTD&quot;).Cells(I, 7)
       Worksheets(&quot;Dec&quot;).Cells(k12, 8) = Worksheets(&quot;YTD&quot;).Cells(I, 8)
       Worksheets(&quot;Dec&quot;).Cells(k12, 9) = Worksheets(&quot;YTD&quot;).Cells(I, 9)
       k12 = k12 + 1
    End If
    Next I
End Sub   
I do recognize this is not the most elegant code!  I was unable to copy the entire row at a time (instead of each cell) – which should be possible.
I have the whole Excel spreadsheet along with the buttons to execute the macro to copy the data and also to clear the data (Jan-Dec, if needed).  I will be happy to e-mail to you, if needed.  Just e-mail me at sbhixson@bellsouth.net
But I am not sure why  you could not get the needed answer by using Pivot table.  Pivot table should be an ideal tool with this type of data.  Let me know what type of report/data you are looking – I will explore via Pivot table.
Good luck &amp; let us know if this is information is of any benefit.]]></description>
		<content:encoded><![CDATA[<p>Ok, Wiggetssis – I spent last night to solve your problem of copying data on various worksheets.  And I tested  &#8211; it works!  I have saved it as Excel 2003 so it should work for you (I have Excel 2007).<br />
Examining your test data I assumed the data contains in 9 columns (Col A thru I) starting with Row 2.  Row 1 may have header information.   On K2  enter =Month(C2).  Now click on lower handle on K2 and drag it all the way to end of data row.  This will populate the Month number based on Col C date information.<br />
Now create the additional 12 worksheets – Jan thru Dec on the same spreadsheet.<br />
The VB code to copy the data will be as follows:<br />
Sub CopyRows()<br />
k1 = 1<br />
k2 = 1<br />
k3 = 1<br />
k4 = 1<br />
K5 = 1<br />
K6 = 1<br />
K7 = 1<br />
K8 = 1<br />
k9 = 1<br />
K10 = 1<br />
K11 = 1<br />
k12 = 1</p>
<p>For I = 2 To 500<br />
  If Cells(I, 11) = 1 Then<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 1) = Worksheets(&#8220;YTD&#8221;).Cells(I, 1)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 2) = Worksheets(&#8220;YTD&#8221;).Cells(I, 2)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 3) = Worksheets(&#8220;YTD&#8221;).Cells(I, 3)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 4) = Worksheets(&#8220;YTD&#8221;).Cells(I, 4)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 5) = Worksheets(&#8220;YTD&#8221;).Cells(I, 5)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 6) = Worksheets(&#8220;YTD&#8221;).Cells(I, 6)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 7) = Worksheets(&#8220;YTD&#8221;).Cells(I, 7)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 8) = Worksheets(&#8220;YTD&#8221;).Cells(I, 8)<br />
       Worksheets(&#8220;Jan&#8221;).Cells(k1, 9) = Worksheets(&#8220;YTD&#8221;).Cells(I, 9)<br />
       k1 = k1 + 1<br />
    ElseIf Cells(I, 11) = 2 Then<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 1) = Worksheets(&#8220;YTD&#8221;).Cells(I, 1)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 2) = Worksheets(&#8220;YTD&#8221;).Cells(I, 2)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 3) = Worksheets(&#8220;YTD&#8221;).Cells(I, 3)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 4) = Worksheets(&#8220;YTD&#8221;).Cells(I, 4)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 5) = Worksheets(&#8220;YTD&#8221;).Cells(I, 5)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 6) = Worksheets(&#8220;YTD&#8221;).Cells(I, 6)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 7) = Worksheets(&#8220;YTD&#8221;).Cells(I, 7)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 8) = Worksheets(&#8220;YTD&#8221;).Cells(I, 8)<br />
       Worksheets(&#8220;Feb&#8221;).Cells(k2, 9) = Worksheets(&#8220;YTD&#8221;).Cells(I, 9)<br />
       k2 = k2 + 1<br />
    ElseIf Cells(I, 11) = 3 Then<br />
       Worksheets(&#8220;Mar&#8221;).Cells(k3,1) = Worksheets(&#8220;YTD&#8221;).Cells(I,1)<br />
            Etc.<br />
       k3 = k3 + 1<br />
    ElseIf Cells(I, 11) = 4 Then<br />
       Worksheets(&#8220;Apr&#8221;).Cells(K4,1)  = Worksheets(&#8220;YTD&#8221;).Cells(I,1)<br />
          Etc…..<br />
       k4 = k4 + 1<br />
             Etc   …. ETC<br />
    ElseIf Cells(I, 11) = 12 Then<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 1) = Worksheets(&#8220;YTD&#8221;).Cells(I, 1)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 2) = Worksheets(&#8220;YTD&#8221;).Cells(I, 2)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 3) = Worksheets(&#8220;YTD&#8221;).Cells(I, 3)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 4) = Worksheets(&#8220;YTD&#8221;).Cells(I, 4)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 5) = Worksheets(&#8220;YTD&#8221;).Cells(I, 5)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 6) = Worksheets(&#8220;YTD&#8221;).Cells(I, 6)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 7) = Worksheets(&#8220;YTD&#8221;).Cells(I, 7)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 8) = Worksheets(&#8220;YTD&#8221;).Cells(I, 8)<br />
       Worksheets(&#8220;Dec&#8221;).Cells(k12, 9) = Worksheets(&#8220;YTD&#8221;).Cells(I, 9)<br />
       k12 = k12 + 1<br />
    End If<br />
    Next I<br />
End Sub<br />
I do recognize this is not the most elegant code!  I was unable to copy the entire row at a time (instead of each cell) – which should be possible.<br />
I have the whole Excel spreadsheet along with the buttons to execute the macro to copy the data and also to clear the data (Jan-Dec, if needed).  I will be happy to e-mail to you, if needed.  Just e-mail me at <a href="mailto:sbhixson@bellsouth.net">sbhixson@bellsouth.net</a><br />
But I am not sure why  you could not get the needed answer by using Pivot table.  Pivot table should be an ideal tool with this type of data.  Let me know what type of report/data you are looking – I will explore via Pivot table.<br />
Good luck &amp; let us know if this is information is of any benefit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chippy088</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/copy-data-from-an-entire-row-in-excel-2003-sheet-to-another-sheet-in-the-same-workbook-automatically/#comment-64429</link>
		<dc:creator>chippy088</dc:creator>
		<pubDate>Fri, 12 Jun 2009 21:46:46 +0000</pubDate>
		<guid isPermaLink="false">#comment-64429</guid>
		<description><![CDATA[ok, I understand where you are coming from. When I have to do things like this I find it easier to try to work it out in pseudo code first.

For purposes of this  discussion, I&#039;m calling the main sheet ytddata, and each sheet is month 01, 02 03 etc

open workbook
open ytddata sheet
sort sheet by month column ascending
  for each non zero cell in column a
  read column3(date)
  select month.indicator
      open sheet(month)
          locate first empty cell in column a
          copy all datacells from row in ytddata sheet to this row
  next column of ytddata sheet
delete all rows of data on ytddata sheet (not including column headings)

when it&#039;s defined in this way, I think it helps for coding in VBA (or code of your choice), the sorting of the date column in the ytddata sheet might help speed it up, but I think it is optional.

Assuming that you are doing the copying periodically(daily, wekly?), you might want to zero the ytddata sheet to speed things up after copying the data to the individual month sheets. otherwise there will be duplicated data on the month sheets..

This makes more sense than the cell A5 in &quot;Yearly Data&quot; contains value &quot;=&#039;December&quot;!A8&quot; solution, as if the data in ytddata sheet is reset to zero, then all the data rows in the month sheet will be effectively zeroed as well. The key word is &#039;copied, not &#039;equal to&#039; as was suggested.

All you need to do now is the coding. Hope this helps.
Dave]]></description>
		<content:encoded><![CDATA[<p>ok, I understand where you are coming from. When I have to do things like this I find it easier to try to work it out in pseudo code first.</p>
<p>For purposes of this  discussion, I&#8217;m calling the main sheet ytddata, and each sheet is month 01, 02 03 etc</p>
<p>open workbook<br />
open ytddata sheet<br />
sort sheet by month column ascending<br />
  for each non zero cell in column a<br />
  read column3(date)<br />
  select month.indicator<br />
      open sheet(month)<br />
          locate first empty cell in column a<br />
          copy all datacells from row in ytddata sheet to this row<br />
  next column of ytddata sheet<br />
delete all rows of data on ytddata sheet (not including column headings)</p>
<p>when it&#8217;s defined in this way, I think it helps for coding in VBA (or code of your choice), the sorting of the date column in the ytddata sheet might help speed it up, but I think it is optional.</p>
<p>Assuming that you are doing the copying periodically(daily, wekly?), you might want to zero the ytddata sheet to speed things up after copying the data to the individual month sheets. otherwise there will be duplicated data on the month sheets..</p>
<p>This makes more sense than the cell A5 in &#8220;Yearly Data&#8221; contains value &#8220;=&#8217;December&#8221;!A8&#8243; solution, as if the data in ytddata sheet is reset to zero, then all the data rows in the month sheet will be effectively zeroed as well. The key word is &#8216;copied, not &#8216;equal to&#8217; as was suggested.</p>
<p>All you need to do now is the coding. Hope this helps.<br />
Dave</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.042 seconds using memcached
Object Caching 395/396 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-19 04:43:59 -->