K
ksnapp
ok, here is the deal
i have 3 columns of data
the first column countains descriptions of the numbers to their right.
the second and third columns countain only numbers
I wrote a sub that will help me sort/add/order them by inserting
bunch of rows with different names and blank cells to thier right.
I then tried to write a sub that inputs the numbers. At first it inpu
its data on every other column.
No i have messed with it and it just clocks, never ending.
here is the code, it should give you a good i idea of what im trying t
do.
any help is appreciated.
Sub mutha_of_all_subs()
Range("E2").Select
Dim A As Double
Dim B As Double
Dim C As Double
Dim D As Double
Dim E As Double
Dim F As Double
Dim G As Double
Dim H As Double
Dim I As Double
Dim J As Double
Dim K As Double
Dim X As Single
Dim Y As Single
Do Until X = 15
casetext = ActiveCell.Value
Select Case (casetext)
Case Is = "TOTAL ACCOUNTS"
A = A + ActiveCell.Offset(0, 1).Value
Y = 1
Case Is = "TOTAL CLOSED ACCOUNTS"
B = B + ActiveCell.Offset(0, 1).Value
Y = 1
Case Is = "ATM BALANCE INQUIRY"
C = C + ActiveCell.Offset(0, 1).Value
Y = 1
Case Is = "ATM WITHDRAWAL"
D = D + ActiveCell.Offset(0, 1).Value
E = E + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "POS PURCHASE"
F = F + ActiveCell.Offset(0, 1).Value
G = G + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "MASTER DEBIT CASH"
H = H + ActiveCell.Offset(0, 1).Value
I = I + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "MASTER DEBIT PURCHASE"
J = J + ActiveCell.Offset(0, 1).Value
K = K + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "OPEN ACCOUNTS"
ActiveCell.Offset(0, 1).Value = A - B
ActiveCell.Offset(0, 2).Value = 0
Y = 1
Case Is = "BALANCE INQUIRY"
ActiveCell.Offset(0, 1).Value = C
ActiveCell.Offset(0, 2).Value = 0
Y = 1
Case Is = "WITHDRAWAL"
ActiveCell.Offset(0, 1).Value = D
ActiveCell.Offset(0, 2).Value = E
Y = 1
Case Is = "POINT OF SALE"
ActiveCell.Offset(0, 1).Value = F
ActiveCell.Offset(0, 2).Value = G
Y = 1
Case Is = "MASTER CASH"
ActiveCell.Offset(0, 1).Value = H
ActiveCell.Offset(0, 2).Value = I
Y = 1
Case Is = "MASTER PURCHASE"
ActiveCell.Offset(0, 1).Value = J
ActiveCell.Offset(0, 2).Value = K
Y = 1
Case Is = "TOTAL TRANSACTIONS"
ActiveCell.Offset(0, 1).Value = D + F + H + J
ActiveCell.Offset(0, 2).Value = E + G + I + K
A = 0
B = 0
C = 0
D = 0
E = 0
F = 0
G = 0
H = 0
I = 0
J = 0
K = 0
Y = 1
End Select
If Y = 1 Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell = "" Then
X = X + 1
Else
X = 0
End If
Y = 0
Loop
End Su
i have 3 columns of data
the first column countains descriptions of the numbers to their right.
the second and third columns countain only numbers
I wrote a sub that will help me sort/add/order them by inserting
bunch of rows with different names and blank cells to thier right.
I then tried to write a sub that inputs the numbers. At first it inpu
its data on every other column.
No i have messed with it and it just clocks, never ending.
here is the code, it should give you a good i idea of what im trying t
do.
any help is appreciated.
Sub mutha_of_all_subs()
Range("E2").Select
Dim A As Double
Dim B As Double
Dim C As Double
Dim D As Double
Dim E As Double
Dim F As Double
Dim G As Double
Dim H As Double
Dim I As Double
Dim J As Double
Dim K As Double
Dim X As Single
Dim Y As Single
Do Until X = 15
casetext = ActiveCell.Value
Select Case (casetext)
Case Is = "TOTAL ACCOUNTS"
A = A + ActiveCell.Offset(0, 1).Value
Y = 1
Case Is = "TOTAL CLOSED ACCOUNTS"
B = B + ActiveCell.Offset(0, 1).Value
Y = 1
Case Is = "ATM BALANCE INQUIRY"
C = C + ActiveCell.Offset(0, 1).Value
Y = 1
Case Is = "ATM WITHDRAWAL"
D = D + ActiveCell.Offset(0, 1).Value
E = E + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "POS PURCHASE"
F = F + ActiveCell.Offset(0, 1).Value
G = G + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "MASTER DEBIT CASH"
H = H + ActiveCell.Offset(0, 1).Value
I = I + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "MASTER DEBIT PURCHASE"
J = J + ActiveCell.Offset(0, 1).Value
K = K + ActiveCell.Offset(0, 2).Value
Y = 1
Case Is = "OPEN ACCOUNTS"
ActiveCell.Offset(0, 1).Value = A - B
ActiveCell.Offset(0, 2).Value = 0
Y = 1
Case Is = "BALANCE INQUIRY"
ActiveCell.Offset(0, 1).Value = C
ActiveCell.Offset(0, 2).Value = 0
Y = 1
Case Is = "WITHDRAWAL"
ActiveCell.Offset(0, 1).Value = D
ActiveCell.Offset(0, 2).Value = E
Y = 1
Case Is = "POINT OF SALE"
ActiveCell.Offset(0, 1).Value = F
ActiveCell.Offset(0, 2).Value = G
Y = 1
Case Is = "MASTER CASH"
ActiveCell.Offset(0, 1).Value = H
ActiveCell.Offset(0, 2).Value = I
Y = 1
Case Is = "MASTER PURCHASE"
ActiveCell.Offset(0, 1).Value = J
ActiveCell.Offset(0, 2).Value = K
Y = 1
Case Is = "TOTAL TRANSACTIONS"
ActiveCell.Offset(0, 1).Value = D + F + H + J
ActiveCell.Offset(0, 2).Value = E + G + I + K
A = 0
B = 0
C = 0
D = 0
E = 0
F = 0
G = 0
H = 0
I = 0
J = 0
K = 0
Y = 1
End Select
If Y = 1 Then
ActiveCell.Offset(1, 0).Select
End If
If ActiveCell = "" Then
X = X + 1
Else
X = 0
End If
Y = 0
Loop
End Su