Sabtu, 12 Juli 2014

RE: [ExcelVBA] VBA code to output initial value, final value & missing entries?

 

Nandkumar,

This would be fairly simple to set up.

Assign the first code and value to variables such as "PreviousCode" and "PreviousValue".

Loop down through the list and do a comparison of the current code to the previous code.

Then if that matches, loop through the list of values until the code changes.

When loop through the values, if the current value is not equal to the previous value + 1, then you know that there are some missing values.  Calculate those by adding 1 each time:

If current value is not equal to previous value +1 then while current value is not equal to previous value + 1, add 1 to previous value and store that number.

 

I had intended to send you some code to do this, but could not this week due to a busy work.  I hope that I have not confused you more than help you.

 

Tim

 

 

 

From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com]
Sent: Tuesday, July 08, 2014 3:06 AM
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] VBA code to output initial value, final value & missing entries?

 

 

Hi Friends,

In worksheet column A contain Branch Code and column B contain Values
I need output initial value , Final value & missing values for each branch Code.

(Please find attached file for more clarification.)

https://www.dropbox.com/s/frjo4r0lixgjm7o/Intial%20%26%20Final.xls

I have lot off branch Codes and Values.

Please see below details.

<<Data sheet>>

Branch
Code Value

0283 1676651
0283 1676652
0283 1676654
0283 1676656
0283 1676657
0583 1617612
0583 1617613
0583 1617614
0583 1617615
0583 1617616

<<Output Sheet>>

(Required Output)

Branch
Code From To Missing
0283 1676651 1676657 1676655, 1676653
0583 1617612 1617616



Any Help May Appriciated....

Regards,
Nandkumar S.

__._,_.___

Posted by: "Tim Lewis" <twlewis@reagan.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Posting Komentar