<?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: Using a For Loop in a Macro</title>
	<atom:link href="http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/feed/" rel="self" type="application/rss+xml" />
	<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/</link>
	<description>Excel Tips and Tricks for All Levels</description>
	<lastBuildDate>Thu, 29 Jul 2010 12:51:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Rahil</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-1072</link>
		<dc:creator>Rahil</dc:creator>
		<pubDate>Mon, 29 Mar 2010 08:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-1072</guid>
		<description>I tried to recreate this macro. In a blank worksheet I hit ‘Alt’ F11 to open VB, then I clicked Insert Module
when the new module opened, I pasted the subroutine data for TestLoop:
Sub TestLoop()
For x = 1 to 10
Cells(x,1) = “Updated”
next x
End Sub

I then closed module and VB and went to Macros
I selected TestLoop and then Run but nothing happened.


Then i Changed the string to valriable name i.e

Sub TestLoop()
     For x = 1 To 10
           Cells(x, 1) = x
           
     Next x
End Sub

Wtih this it prints the value of x which starts from 1 to 10 in first column.

Appriciated the help provided, Thanks  EH</description>
		<content:encoded><![CDATA[<p>I tried to recreate this macro. In a blank worksheet I hit ‘Alt’ F11 to open VB, then I clicked Insert Module<br />
when the new module opened, I pasted the subroutine data for TestLoop:<br />
Sub TestLoop()<br />
For x = 1 to 10<br />
Cells(x,1) = “Updated”<br />
next x<br />
End Sub</p>
<p>I then closed module and VB and went to Macros<br />
I selected TestLoop and then Run but nothing happened.</p>
<p>Then i Changed the string to valriable name i.e</p>
<p>Sub TestLoop()<br />
     For x = 1 To 10<br />
           Cells(x, 1) = x</p>
<p>     Next x<br />
End Sub</p>
<p>Wtih this it prints the value of x which starts from 1 to 10 in first column.</p>
<p>Appriciated the help provided, Thanks  EH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Automobile India</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-933</link>
		<dc:creator>Automobile India</dc:creator>
		<pubDate>Mon, 02 Nov 2009 01:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-933</guid>
		<description>I would like to Loop this macro until their is no more data in the report. Does anyone know how to do it?</description>
		<content:encoded><![CDATA[<p>I would like to Loop this macro until their is no more data in the report. Does anyone know how to do it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Misterpiz</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-931</link>
		<dc:creator>Misterpiz</dc:creator>
		<pubDate>Fri, 30 Oct 2009 12:35:52 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-931</guid>
		<description>Hello, I am looking for a macro that will take data from yesterday, subtract todays and give me the differece in a specific cell.  I need to run this for 10 different columns, with 6 different categories (Total, Major, Critical, Minor, Internal, and Admin).  I would appreciate any and all help

Thank you</description>
		<content:encoded><![CDATA[<p>Hello, I am looking for a macro that will take data from yesterday, subtract todays and give me the differece in a specific cell.  I need to run this for 10 different columns, with 6 different categories (Total, Major, Critical, Minor, Internal, and Admin).  I would appreciate any and all help</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-888</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Tue, 22 Sep 2009 09:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-888</guid>
		<description>I&#039;ve just tried the same and couldn&#039;t get it to work. Turns out you need to edit over the inverted comas as they seem to be slightly different characters. After doing that the simple macro should run properly. Its a good, simple example so thanks for this. D</description>
		<content:encoded><![CDATA[<p>I&#8217;ve just tried the same and couldn&#8217;t get it to work. Turns out you need to edit over the inverted comas as they seem to be slightly different characters. After doing that the simple macro should run properly. Its a good, simple example so thanks for this. D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deekarvois</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-881</link>
		<dc:creator>deekarvois</dc:creator>
		<pubDate>Thu, 17 Sep 2009 20:31:20 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-881</guid>
		<description>I tried to recreate this macro. In a blank worksheet I hit &#039;Alt&#039; F11 to open VB, then I clicked Insert Module
when the new module opened, I pasted the subroutine data for TestLoop: 
Sub TestLoop()
     For x = 1 to 10
           Cells(x,1) = “Updated”
     next x
End Sub

I then closed module and VB and went to Macros
I selected TestLoop and then Run but nothing happened.
I started with my pointer at A1 

Any idea of what went wrong. Thanks.</description>
		<content:encoded><![CDATA[<p>I tried to recreate this macro. In a blank worksheet I hit &#8216;Alt&#8217; F11 to open VB, then I clicked Insert Module<br />
when the new module opened, I pasted the subroutine data for TestLoop:<br />
Sub TestLoop()<br />
     For x = 1 to 10<br />
           Cells(x,1) = “Updated”<br />
     next x<br />
End Sub</p>
<p>I then closed module and VB and went to Macros<br />
I selected TestLoop and then Run but nothing happened.<br />
I started with my pointer at A1 </p>
<p>Any idea of what went wrong. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Navaneetha kumar</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-817</link>
		<dc:creator>Navaneetha kumar</dc:creator>
		<pubDate>Thu, 30 Jul 2009 09:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-817</guid>
		<description>In first cell type : =A1&amp;”0100? 
Remaining cells :   =IF(A1=A2,B1+100,CONCATENATE(A1,&quot;0100&quot;))</description>
		<content:encoded><![CDATA[<p>In first cell type : =A1&amp;”0100?<br />
Remaining cells :   =IF(A1=A2,B1+100,CONCATENATE(A1,&#8221;0100&#8243;))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-806</link>
		<dc:creator>john</dc:creator>
		<pubDate>Sat, 11 Jul 2009 04:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-806</guid>
		<description>Hi STLlove-thanks for visiting the site...

Try someting like this maybe (I assume in the suggestion that 11111 would be in the first column and the result would be in the 2nd):

In the first cell, just use this simple formula: =A1&amp;&quot;0100&quot;

And in the remaining cells, use this formula: =IF(A2=A1,A2&amp;&quot;0&quot;&amp;IF(MID(B1,6,1)=&quot;0&quot;,VALUE(RIGHT(B1,3))+100,VALUE(RIGHT(B1,4))+100))

This will only work if the each cell in column A is not preceeded by any blanks.  The result will be text, but you can use VALUE to change back to a number. 

Hope that works for you.

John</description>
		<content:encoded><![CDATA[<p>Hi STLlove-thanks for visiting the site&#8230;</p>
<p>Try someting like this maybe (I assume in the suggestion that 11111 would be in the first column and the result would be in the 2nd):</p>
<p>In the first cell, just use this simple formula: =A1&#038;&#8221;0100&#8243;</p>
<p>And in the remaining cells, use this formula: =IF(A2=A1,A2&#038;&#8221;0&#8243;&#038;IF(MID(B1,6,1)=&#8221;0&#8243;,VALUE(RIGHT(B1,3))+100,VALUE(RIGHT(B1,4))+100))</p>
<p>This will only work if the each cell in column A is not preceeded by any blanks.  The result will be text, but you can use VALUE to change back to a number. </p>
<p>Hope that works for you.</p>
<p>John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: STLlove</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-805</link>
		<dc:creator>STLlove</dc:creator>
		<pubDate>Fri, 10 Jul 2009 19:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-805</guid>
		<description>I am looking for a formula that does the following:   Can you help? 
 
Adds 0100 to each cell in column A and then increases by 100 for each line after as long as the claim number is the same.Then start over with 0100 when the claim number changes.
 
 CLM #              Result
 
11111             111110100
11111             111110200
11111             111110300
11111             111110400
22222             222220100
22222             222220200
22222             222220300
22222             222220400</description>
		<content:encoded><![CDATA[<p>I am looking for a formula that does the following:   Can you help? </p>
<p>Adds 0100 to each cell in column A and then increases by 100 for each line after as long as the claim number is the same.Then start over with 0100 when the claim number changes.</p>
<p> CLM #              Result</p>
<p>11111             111110100<br />
11111             111110200<br />
11111             111110300<br />
11111             111110400<br />
22222             222220100<br />
22222             222220200<br />
22222             222220300<br />
22222             222220400</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gopal</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-575</link>
		<dc:creator>Gopal</dc:creator>
		<pubDate>Sat, 22 Nov 2008 08:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-575</guid>
		<description>Hi,
I have a situation that i need to develop a macro which shift month values based on the value entered in &quot;Month Shift&quot; Column. following is the case, if we entered 1 under month shift then the value should move 1 month forward and should copy under Months_Factor,
If we enter 2 under Month shift Months values carry forward 2  months that means Months values copied from march.
so January is the base month.
I am new to write  macros,Can any one please help me out for this case

Case:                    Months                             Months _Factor
Month Shift         Jan Feb Mar April May          Jan Feb Mar April May
  1                      10 20   30   40   50                  10  20   30   40
  2                      10 20   30   40   50                       10  20 30

Thanks and Regards,
Gopal</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have a situation that i need to develop a macro which shift month values based on the value entered in &#8220;Month Shift&#8221; Column. following is the case, if we entered 1 under month shift then the value should move 1 month forward and should copy under Months_Factor,<br />
If we enter 2 under Month shift Months values carry forward 2  months that means Months values copied from march.<br />
so January is the base month.<br />
I am new to write  macros,Can any one please help me out for this case</p>
<p>Case:                    Months                             Months _Factor<br />
Month Shift         Jan Feb Mar April May          Jan Feb Mar April May<br />
  1                      10 20   30   40   50                  10  20   30   40<br />
  2                      10 20   30   40   50                       10  20 30</p>
<p>Thanks and Regards,<br />
Gopal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://excelhints.com/2008/10/12/using-a-for-loop-in-a-macro/comment-page-1/#comment-538</link>
		<dc:creator>john</dc:creator>
		<pubDate>Thu, 13 Nov 2008 17:36:44 +0000</pubDate>
		<guid isPermaLink="false">http://excelhints.com/?p=192#comment-538</guid>
		<description>Well there are two ways I can quickly think of to do this.  It can be done with adding an additional column and using a vlookup formula to search for the values in column C.  For any values that aren&#039;t found, you can filter the column and delete those rows.

It can also be done with a VBA macro.  You can have the macro loop through the column for each value and then run a delete command on the rows that are found in column C.  

Does that help?</description>
		<content:encoded><![CDATA[<p>Well there are two ways I can quickly think of to do this.  It can be done with adding an additional column and using a vlookup formula to search for the values in column C.  For any values that aren&#8217;t found, you can filter the column and delete those rows.</p>
<p>It can also be done with a VBA macro.  You can have the macro loop through the column for each value and then run a delete command on the rows that are found in column C.  </p>
<p>Does that help?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
