When I do this nothing happens. It is supposed to post to the journal the accounts and amounts I have selected. Can you see what is wrong?

jaret12p

New Member
Joined
Jun 19, 2012
Messages
5
Sub tranAcct()
Dim eRow As Integer
Dim nextBox As Integer

eRow = BlankRow("Journal", 3, 2) + 1

With TransactionEntry
For nextBox = 1 To 6
If .Controls("acctCbx" & nextBox).Value <> "" Then
Sheets("Journal").Cells(eRow, 2).Value = .Controls("acctCbx" & nextBox).Value
If .Controls("Creditbutton" & nextBox).Value = True Then
Sheets("Journal").Cells(eRow, 2).InsertIndent 1
Sheets("Journal").Cells(eRow, 7).Value = .Controls("tbxAmnt" & nextBox)
ElseIf .Controls("Debitbutton" & nextBox).Value = True Then
Sheets("Journal").Cells(eRow, 5).Value = .Controls("tbxAmnt" & nextBox)
End If
eRow = eRow + 1
End If
Next
End With

Sheets("Journal").Cells(eRow, 2).Value = TransactionEntry.txbDescription
Sheets("Journal").Cells(eRow, 2).InsertIndent 2
Sheets("Journal").Cells(eRow, 2).Font.Italic = True

End Sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi jaret12p,

Is transaction entry "set" somewhere else like in the declarations?
 
Upvote 0
Function BlankRow(sName As String, ByVal sRow As Integer, ByVal sCol As Integer) As Integer
With Worksheets(sName)
BlankRow = .Cells(.Rows.Count, sCol).End(xlUp).Row + 1
End With
End Function
 
Upvote 0
I'm assuming TransactionEntry is a form or something?

Can you post your entire code?
 
Upvote 0

Forum statistics

Threads
1,211,841
Messages
6,104,302
Members
447,901
Latest member
boy3hc2004

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top