Modifying Macro - Accounting Analysis

Jan 18, 2009

I have the macro shown below, which I found in a 2003 issue of the journal of accountancy - and it works great. However, it only works on a data set that begins in cell A1. I want to incorporate it into a spreadsheet I have where my data set begins in cell E15 and goes down from there(column E will be the only column that this macro will need to run on and I need it to work on a data set that will vary in length). This macro performs a Benford analysis, which analyzes the first and second number of a data set.

Dim Arrayone(0 To 9) As Integer
Dim Arraytwo(0 To 9) As Integer
Dim Arraythree(0 To 9) As Integer
Dim Arrayfour(0 To 9) As Integer
Dim Arrayfive(0 To 9) As Integer
Dim Arraysix(0 To 9) As Integer
Dim Arrayseven(0 To 9) As Integer
Dim Arrayeight(0 To 9) As Integer
Dim Arraynine(0 To 9) As Integer
Dim Arrayzero(0 To 9) As Integer
Dim Arraytwotest(10 To 99) As Integer

Dim x, I

Dim Row As Long, Col As Long, Step As Long, Colcells

Dim Digits As Long, Total As Long

View 9 Replies


ADVERTISEMENT

Modifying Accounting Custom Format?

Oct 31, 2013

I'm using this custom format

Code:
_-£* #,##0.00_-;[Red]_-£* #,##0.00_-;_-£* "-"??_-;_-@_-

How do I modify it so that if the value is 0.00 then 0.00 is showed and not the current "-"?

View 3 Replies View Related

Writing/modifying An Macro

Oct 18, 2007

Every month I download a report from a state agency that I need to reformat, create charts from and send reminder emails based on some of the data. The report is downloaded as an EXCEL workbook containing a single worksheet. The worksheet is preformatted as a printed report. I have no control of this formatting and I can not get the data as a .csv file. The report contains 3 sections. See detailed report description below.

What I want to do:
1.Is copy the 3rd section of the report to a new worksheet.
2.Sort the new worksheet by name, and date.
3.Filter some names based on resource type.
4.Create a new file, which will be attached to an email to my boss for follow-up.

Originally I used the built-in EXCEL macro recording function and this worked for a couple of months. Then the number of rows in the 2nd section varied and my generated worksheet failed to sort correctly, and I lost the column headings so my filter no longer worked. The results were not something I could forward. I do not know how to modify the macro to search for the literals which end section 2 or start section 3 so I can copy the correct data to the new worksheet. I am not a VBA programmer, just an old-fart trying to do some administrative volunteer support for an important program, and really do not want to become one.

Detail Report Description:
Section 1: Headings –contain fixed headings in merged & centered cells.
Row 1 – Report heading 1 in merged cells A1–I1
Row 2 – Report heading 2 in merged cells A2-I2
Row 3 – Report heading 3 in merged cells A3–I3
Row 4 – Blank row............

View 9 Replies View Related

Modifying Macro - Pasting Over Row Of Data

Aug 11, 2014

Macro (see below).

I have two sheets 1) ap modified 2) gl download

It's merging the two sheets together. however, it's pasting over the last row of data. For example, gl download has data from row 4 to row 100. The Macro is pasting data from ap modified starting in row 100 of gl download instead of row 101. How can i correct this?

Sub C_Merge()
Dim w1 As Worksheet, w2 As Worksheet
Set w1 = Sheets("ap modified")
Set w2 = Sheets("gl download")
Dim lr1 As Long, lr2 As Long

[Code] .........

View 3 Replies View Related

Macro To Format Raw Data From Accounting System

Jun 14, 2013

I export raw data from my accounting system each month that I then format for use in another application that uses the data to produce customer statements. I have attached a file that shows the raw data in the first sheet and the formatted data in the second sheet. I recorded a macro while I did the process but I need to change the code to deal with dynamic data as the number of rows may be different every month.

Here are the steps I go through:
1. Clear the first 3 rows and the last 5 rows
2. Copy the totals in the last row of the data and paste them in the first row
3. Subtotal the different categories in row 2 and add a validity check
4. Add a new column A with a formula to add customer numbers on each line
=IF(ISERROR(FIND("00000",B5)),A4,B5
5. Copy the formulas and paste values over them
6. Filter the data to show blanks under the "Doc Date" column, delete all rows
7. Filter the data to show blanks under the "Type" column, delete all rows
8. Filter the data to show "Total:" under the "Apply No" column, delete all rows
9. Turn off filters, format all numbers in accounting format
10. Check the validation at the top to ensure no transactions were deleted

View 6 Replies View Related

Merge Two Worksheet Into 3rd Sheet (modifying A Macro)

Jun 2, 2008

i have three worksheets: "List 1", "List 2" and "New ist".I want to merge the first two sheets into third.

List 1:

View 14 Replies View Related

Find And Replace Macro - Modifying Code In Engagement

Jan 27, 2014

I am trying to make a find and replace macro for multiple items.

Please see the attached file for further explanation : macro.xls‎

View 3 Replies View Related

Data Analysis With Macro

May 3, 2007

i want to run data analisys(Rank and percentile) on each row in my sheet and put the results on a new sheet
(the reuslts are 4 rows ) My problem is some how the command of the run analisysWon't run the command

kStop = . Cells(1, Columns.Count).End(xlToLeft).Column
Sheets.Add
ActiveSheet.Name = "Analisys_Results"
Sheets(" Total time data").Select
Var = 4
Var1 = 8
For ILoop = 1 To kStop
If (ILoop > 1) Then
Var = Var + 4
Var1 = Var + 4
End If.....................

View 4 Replies View Related

Incorporating Data Analysis: Regression Into A Macro

Apr 10, 2009

I'm trying to write a macro that will analyze data from one spreadsheet and do a regression. The information I want to be output on the same sheet. I tried to use the record function, but I got an error. It said "Run-time error '1004': ATPVBAEN.XLA could not be found. The code read:

View 2 Replies View Related

Macro Call To Analysis Toolpack Subroutine

Feb 2, 2007

I know this problem has been answered before, but my browser is giving me hell when I try to use the search function, so here I am clogging up the post forum.

I would like to be able to access one of the subroutine functions built into the Analyis Toolpack add-in. Using the macro-recorder, here's what I came up with:

Application.Run "ATPVBAEN.XLA!Random", ActiveSheet.Range("$F$23"), 1, _
15600, 7, , ActiveSheet.Range("$A$3:$B$12")

I get a run-time error 1004 when executing stating that "ATPVBAEN.XLA Could Not Be Found". I'm sure this has to do with they improper way in which I'm trying to call this function.

View 9 Replies View Related

Data Analysis: Place Called Data Analysis Under Tools

Nov 22, 2006

in excel, is there a place called data analysis under tools? im an exchange student in sweden andthe work that teacher gave me is half swedish and half english.. im looking for histogram there.

View 3 Replies View Related

Modifying VBA Code

Feb 16, 2009

This code works great for me, but I need some help modifying it. This code searches for data in the whole sheet, two things I would like to do is limit the search range to one column and then to find the whole string, not partials, for example, find 331 without finding all the 33's or 31's.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
If Target.Address = "$A$1" Then
Set MyRange = Cells.Find(what:=Target.Value, After:=Target)
If Not MyRange Is Nothing Then MyRange.Select
End If
End Sub

View 9 Replies View Related

Accounting Prepayment Schedule

Jan 28, 2010

I'm trying to automate the calculation of my prepayment schedule. The linked image http://img402.imageshack.us/img402/2...mentqueryp.jpg shows the basic layout of how it will look. The yellow cells are going to be the only input cells but i'm unsure what formula will achieve the desired result i'm looking for across the remainder of the spreadsheet. Essentially I need the formula to look at the period (start and end dates) the invoice covers and apportion it correctly. The apportionment isn't a straight equal division per month though as it has to be calculated according to what element of the expenditure hasn't been realised yet.

For example in the car park rent line the figure of £8,000 in July is derived from the fact that that is how much hasn't effectively been incurred yet as it relates to the remainder of the invoiced period (Aug - Mar) and is calculated as 8/12 x £12000.

I hope you understand what i'm requesting, if not, let me know and i'll try to provide a better explanation.

View 7 Replies View Related

Copy Row - Accounting Monopoly

May 20, 2014

I am trying to make an accounting spreadsheet to be used with the game monopoly for my business students.

Each row I want to copy to a separate sheet within Excel.

For instance the row with the account title cash I want that to copy entire row to the cash worksheet. "go" revenue to the "go"revenue worksheet etc.

Date
Account
Debit
Credit

May 20
Cash
200

[Code] .......

Here are the sheets I set up to transfer to depending on the account title:

Cash

Properties

Acct.Pay. Monopoly Loan

"Go" Revenue

Rent Revenue

Misc. Revenue

Rent Expense

Misc. Expense

View 4 Replies View Related

$ Not Showing Up In Accounting Format

Jun 26, 2014

I have formatted several cells with an Accounting style. However, the dollar sign doesn't show up until I click in the command line.

View 5 Replies View Related

Modifying Data Before Pasting

Nov 6, 2008

I am copying some data from one workbook and pasting the data into another workbook depending on certain criteria (using autofilter) using excel VBA. For only One column i need to multiply data by 100 (i.e. convert it into percentage) For example column A in source worksheet has all values and i will paste it in column D of target worksheet. But before pasting i need to multiply the data by 100 so column D in target worksheet has values in %.

View 3 Replies View Related

Modifying Entries Into 1 Line?

Jan 24, 2012

I need a way to take the below example and combine each entry into 1 line.

ALRSItem Number/QuantityStockingDescription On HandUnit Actual Cost170PC1832PCB1un43.75circuit de PC1832 nouvelle version 5010 (P832)Avg. Unit Value:43.750000Costing Method: Moving AverageCosting Unit:un250282un2.05Braquette pour contact anti-vandale 112 ADEMCOAvg. Unit Value:1.025000Costing Method: Moving AverageCosting Unit:un

I would like to take each part and place the specific part information provided into 1 line for each part number.

View 1 Replies View Related

VBA Oddity, Modifying For Loop

Aug 8, 2007

It's refreshing to know that to make VBA even more lightning fast it doesn't check the For limiting variable. /sarcasm mode off

Does the following surprise anyone? Surprises me. (And yes, I know what an Exit For is. This code is designed solely to illustrate the point.)

Sub JimmyLoopVar()
Dim i As Long, K As Long
K = 6
For i = 0 To K
If (i > 3) Then K = 2
Debug.Print i; ; K
Next
End Sub
So the loop runs 7 times regardless of K! (At least on XL03 )

View 9 Replies View Related

Modifying A VBA Code To Del Rows

May 24, 2008

I am trying to modify the below code in order for it to:

1) Check the cells in Column A to find any blank cells and zero values. If the macro finds a blank cell or a zero then delete the entire row.
2) Check the cells in Column D for any blank cells and "N/A" (this N/A is text, it is not an excel error). If the macro finds a blank cell or "N/A" then delete the entire row.

Here is the old code

Sub DL()
Dim lastrow As Long, i As Long
With ActiveSheet
On Error Resume Next
.Columns(3).SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
On Error GoTo 0
lastrow = .Cells(Rows.Count, 3).End(xlUp).Row
For i = lastrow To 1 Step -1
If .Range("C" & i).Value = 0 And .Range("D" & i).Value = 0 Then .Rows(i).Delete
If .Range("C" & i).Value = "N/A" Then .Rows(i).Delete
Next i
End With
End Sub
Here is the modified code...

Sub DL()
Dim lastrow As Long, i As Long
With ActiveSheet
On Error Resume Next
.Columns(3).SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
On Error GoTo 0
lastrow = .Cells(Rows.Count, 3).End(xlUp).Row
For i = lastrow To 1 Step -1
If .Range("A" & i).Value = 0 And .Range("A" & i).Value = "" Then .Rows(i).Delete
If .Range("D" & i).Value = "" and .Rang("D" & i).Value ="N/A" Then .Rows(i).Delete
Next i
End With
End Sub

1) Is this the correct and efficient way to accomplish the task?

2) How to i change this in order to select a specific sheet?

View 9 Replies View Related

Conditional Formatting (VBA) - Needs Modifying

Jun 28, 2006

Basically my code works fine if I enter a number into the reference cell. But for my actual application, I need it to update the reference cell's background color when I enter other data. B21 has a =IF(COUNT(B18, B19, B20) < 3,"",B18 * B19 * B20) statement. So as I modify B18, B19, B20 it should update B21's background color. Here is the VBA:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B21")) Is Nothing Then
If Target < Worksheets("OEE Data").Range("K6").Value Then
Target.Interior.Color = vbRed
ElseIf Target >= Worksheets("OEE Data").Range("K6") And Target < Worksheets("OEE Data").Range("L6") Then
Target.Interior.Color = vbYellow
ElseIf Target >= Worksheets("OEE Data").Range("L6") Then
Target.Interior.Color = vbGreen
Else
Target.Interior.Color = vbWhite
End If
End If
End Sub

Obviously my VBA isn't sound and hence won't apply any background to B21. If I just change it to AA1 and enter the criteria into AA1, it's background changes without problem. The reason I need this in VBA is because in the cFormatting I need the first condition to be 'is equal' ="" (white background) or it defaults my BLANK CELL to being > 1 (Green background). This is why I need 4 conditional statements.

View 2 Replies View Related

Modifying Text Within A Cell

Jul 19, 2006

I have imported text from a database that has names shown as "last name, first name" in a single cell and am trying to figure out if it is possible to modify those names to "first name last name." I would also like to see if I could just have the first name transferred to a different cell.

View 3 Replies View Related

VBA Find Zero Value (Dash) In Accounting Format

Aug 15, 2013

I have a column of data that may or may not have a formula in them. The cells are formatted in Accounting, w/o the leading $ sign. (i.e. 133.57) The value zero shows up as a hyphen or dash.

The issue is the format of the cell. In that attached worksheet, i inserted two formulas in cell b6 and b7. Both formulas are exactly the same, but the formatting is different. One is in the accounting format, but the other is in general. When I run the code, only the general formatted cell gets found.

My real worksheet is in the accounting formatted code, so I don't want to change my worksheet's numbers into a general format. How I can find the zero value thats in an accounting format?

Below is a strip down version of the code.

VB:
Sub test()[COLOR=#333333]
[/COLOR] Dim rLookInADR As Range
Dim foundcell As Range
Set rLookInADR = Range("b1:b380")
Set foundcell = rLookInADR.Find(what:=0, LookIn:=xlValues, lookat:=xlWhole)
MsgBox (foundcell.Row)
End Sub
[COLOR=#333333][/COLOR]

View 5 Replies View Related

Using IF Formula And Accounting For Zero Or Null Cell?

Dec 4, 2013

Looking for a way to correct what is going on with row 9. I need it to return either zero or empty, but also include the current formula.

View 3 Replies View Related

Adding Columns To Accounting Template?

Jun 25, 2014

I just downloaded an income/expense template from Zillow to manage my rental properties. The template works great but it's only set up for 5 houses and I need more columns as I own more than 5. In the attached template the houses are listed by property codes and that is the column that I need to add to.

View 8 Replies View Related

Accounting For Multiple Possible Values In A IF(AND Statement

Dec 4, 2008

IF B1 has a possible value ranging from 1 - 5, and IF the value in E1 is equal or great than 2,5,10,10,15 BUT 2,5,10,10,15 need to match to specific ranges set in B1 1=2, 2=5, ,3=10 ,4=10 ,5=15 THEN IF TRUE "WITHIN" IF FALSE "NEEDS UPDATE"

Got help earlier with this formula: =IF(AND(B1=1,E1<=5),"WITHIN","NEEDS UPDATE") :D Worked Great! This was my attempt at expand that formula:

View 3 Replies View Related

Using The Accounting Format With No Decimal Places

Jan 15, 2009

I am using Excel 2003. I am attempting to use the Accounting format with numbers that should not have any decimal places (although what is entered might have a decimal place). The numbers line up fine on the right, however, the dollar signs on the left are not lining up. It looks something like:

View 4 Replies View Related

Setting Format Cell Accounting Using Vba

Mar 26, 2009

i am doing some calculations using vba in excel, i need to know how to set the cell format to 'accounting' in vba ?

View 2 Replies View Related

Array Formulas And Accounting Consolidation?

Nov 16, 2013

I would like to master the dreaded array formulas. Any Excel based accounting consolidation tool or other consolidation tool out there that I could adapt to consolidate group accounts on a monthly basis.

View 5 Replies View Related

VBA COde That Works For My Accounting Journal

Apr 22, 2007

I am trying to create this macro for my accounting journal What I want to happen is that in my sheet1 if the 1st cell in column a is "CASH" then the whole row should be copied and pasted in sheet 2. i want this to happen from the first cell in a column until the very last data in column a which means i am not certain up to what row number it will have data since this is a journal with uncertain number of transactions.

View 9 Replies View Related

Determine Accounting 4-4-5 Month From Date

May 7, 2009

I am trying to determine if a specific date is what week in a 4-4-5 accounting month. See attached file. Is there a formula that can be used to do this???

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved