Stumbleupon Facebook Twitter Digg Google Delicious Linkedin
TechNews

Is there a way to create a specific number of duplicates of a certain number?

Posted: 17 Jan 2012

Tags: Is there a way to create a specific number of duplicates of a certain number there way create specific number duplicates certain


Is there a way to create a specific number of duplicates of a certain number?

Source: qph.cf.quoracdn.net

Question:

I have a spreadsheet that I used the count function to screen thousands of rows of data in about 12 lines. I wonder if it is possible to convert data in individual numbers count.

Answer:

This macro just assumes that entries are Col A and b and the output in the col C:

Sub filldown()
Dim n as long, I as long, NN: Long, II: Long K as long
N = cells (Rows.Count, "A").End (xlUp).Line
K = 1
For NN = 1 to N
v = cells (NN, "A").Value
I = cells (NN, "B").Value
II = 1 TO I
Cells (K, "C").Value = v
K = K + 1
Next
Next
End Sub


Macros are very easy to install and use:

1 ALT - F11 brings the VBE window
2 ALT-I
ALT - M opens a fresh module
3 paste these things in and close the VBE window

If you save the workbook, the macro will be saved with it.

To delete the macro:

1 raise the VBE window as above
2 delete the code
3 Close the VBE window

To use the Excel macro:

1 ALT - F8
2. Select the macro
3 Touch RUN

To learn more about macros in General, see:

http://www.MVPs.org/dmcritchie/Excel/getstarted.htm

Rate this article:


  • Pages:
  • 1

0 Comments

Add Your Comment !