Hi. I came over that piece of code that help me convert numbers (>1) in one row into multiple row with one number (1). The macro is made to stop over a blank cell. This my problem I can't resolve. Right now, I'm doing it manually on every group of numbers until it reach a blank cell. It is sooo long! I try some modifications but without success. I'm sure it's easy but I can't figure it out. Also, once figure it out, I could write something a the end of my column to stop the macro (like "N/A" or whatever).
I'm sure someone has a clue and help would be greatly appreciated.
Thanks!
Here's the Macro:
Sub Multicator_Line_Page()
' Line Multicator
' Divide every group (row) into units
' Author: no me (a friend).
' Hotkey: Ctrl+p
Dim IQte, itmp As Integer
Dim sRow, sColumn As String
Dim erreur, sortie As Integer
erreur = 0
sortie = 0
Do Until (IsNumeric(ActiveCell) = False) Or (erreur = 1) Or (sortie = 1)
If IsNumeric(ActiveCell) And ActiveCell.Value > 0 Then
IQte = ActiveCell.Value
itmp = IQte
ActiveCell.Value = 1
sRow = ActiveCell.Row
sColumn = ActiveCell.Column
Rows(ActiveCell.Row).Select
Selection.Copy
Do Until itmp < 2
Selection.Insert Shift:=xlDown
Rows(ActiveCell.Row).Select
Selection.Copy
itmp = itmp - 1
Loop
' next entry
ActiveCell.Offset(IQte, sColumn - 1).Select
'empty cell
If IsEmpty(ActiveCell.Value) Then
sortie = 1
MsgBox "That's it!"
End If
Else
MsgBox "Error, this is not a number or number <= 0!"
erreur = 1
End If
Loop
End Sub
Bookmarks