Skip to content

Instantly share code, notes, and snippets.

@ammist
Last active December 27, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ammist/55a2fdb3a32e0b35fb42 to your computer and use it in GitHub Desktop.
Save ammist/55a2fdb3a32e0b35fb42 to your computer and use it in GitHub Desktop.
Excel VBA file for converting from Square download csv file to the IIF Importer from BigRed consulting.
Sub SquareTransactionMove()
'
' SquareTransactionMove Macro
'
'
' Setup Column Names
Dim receiptDate As Integer
Dim memo As Integer
Dim receiptTotal As Integer
Dim receiptAccount As Integer
Dim squarePaymentCard As Integer
Dim squarePaymentCash As Integer
Dim squareDate As Integer
Dim squareMemo As Integer
Dim squareTotal As Integer
receiptDate = 2 'column b
memo = 5 'column e
receiptPriceEach = 10 ' column j
receiptTotal = 11 ' column k
receiptAccount = 7 ' column g
squarePaymentCard = 17 ' column f
squarePaymentCash = 8 ' column 8
squareDate = 1 'column a
squareID = 20 ' column t
squareMemo = 23 ' column w
squareItem = 22 ' column v
squareTotal = 6 'column f
Dim counter As Integer
Dim startrow As Integer
Dim paymenttype As String
For counter = 1 To 82
startrow = counter * 2
Sheets("Sales Receipt").Cells(startrow, receiptDate).Value = Sheets("Square Transactions").Cells(counter + 1, squareDate)
Sheets("Sales Receipt").Cells(startrow, memo).Value = Sheets("Square Transactions").Cells(counter + 1, squareMemo)
Sheets("Sales Receipt").Cells(startrow + 1, memo).Value = Sheets("Square Transactions").Cells(counter + 1, squareItem)
Sheets("Sales Receipt").Cells(startrow, receiptTotal).Value = Sheets("Square Transactions").Cells(counter + 1, squareTotal)
Sheets("Sales Receipt").Cells(startrow + 1, receiptPriceEach).Value = Sheets("Square Transactions").Cells(counter + 1, squareTotal)
If Sheets("Square Transactions").Cells(counter + 1, squarePaymentCash).Value > 0 Then
Sheets("Sales Receipt").Cells(startrow, receiptAccount).Value = "Petty Cash"
Else
Sheets("Sales Receipt").Cells(startrow, receiptAccount).Value = "Square"
End If
Sheets("Sales Receipt").Cells(startrow, 1).Value = "New Transaction"
Sheets("Sales Receipt").Cells(startrow, 3).Value = "Sales Receipt"
Sheets("Sales Receipt").Cells(startrow + 1, 12).Value = "N"
Sheets("Sales Receipt").Cells(startrow + 1, 9).Value = -1
Sheets("Sales Receipt").Cells(startrow + 1, 11).Value = -1 * Sheets("Sales Receipt").Cells(startrow, receiptTotal).Value
'todo elements
Sheets("Sales Receipt").Cells(startrow, 4).Interior.Color = RGB(245, 245, 200)
Sheets("Sales Receipt").Cells(startrow, 6).Interior.Color = RGB(245, 245, 200)
Sheets("Sales Receipt").Cells(startrow + 1, 7).Interior.Color = RGB(245, 245, 200)
Sheets("Sales Receipt").Cells(startrow, 6).Interior.Color = RGB(245, 245, 200)
Sheets("Sales Receipt").Cells(startrow, 8).Interior.Color = RGB(245, 245, 200)
Sheets("Sales Receipt").Cells(startrow + 1, 10).Interior.Color = RGB(245, 245, 200)
Next counter
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment