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


ADVERTISEMENT

2002 Code V 97 Code: Add A Small Workbook Open Event Code Which Works For Me But Debugs For The Others

Jan 27, 2009

I use excel 2002 but some of my office are on 97, i want to add a small workbook open event code which works for me but debugs for the others?? The code is basically, go to a tab, on that tab and that range sort..

View 2 Replies View Related

Code Works In One Workbook But Not Another

Feb 19, 2009

This code, supplied through this forum, works perfectly in one workbook but not another. I have created a range called ColourRange, one called ColourIndex but I am getting a '400' error message when I attempt to run it. Can anone explain to me (in very simple terms) why it won't work?

Sub CopyFormatMMT()
'Colour code Owners
Dim r As Range
Dim f As Range
Dim c As Range
Dim j As Range
Set r = Range("ColourRangeMMT")
Set f = Range("ColourIndex")
Range("ColourRangeMMT").Select
Selection.Interior.ColorIndex = xlNone
For Each c In r.Cells
For Each j In f.Cells
If c = j Then
c.Interior.ColorIndex = j.Interior.ColorIndex
End If
Next j
Next c
Range("C9").Select
End Sub

View 2 Replies View Related

Code Only Works Every Other Time I Run It

Mar 19, 2007

I am trying to programmatically select an item from a single selection listbox (i.e., set to fmMultiSelectSingle). The following code works properly only every other time I run it; the problem is extremely repeatable.

Const storeStartCell = "B5000"
Private Sub ListBox_CounterTOs_Click()
selectedTOName = CStr(Mid(Worksheets("Sheet1"). Range(storeStartCell).Offset(ListBox_CounterTOs.ListIndex, 0), 3, 3))
selectedTONumber = CInt(Mid(Worksheets("Sheet1").Range(storeStartCell).Offset(ListBox_CounterTOs.ListIndex, 0), 6, 4))
ListBox_TO_Name.Value = selectedTOName
ListBox_TO_Number.Value = selectedTONumber
End Sub

The times that it works, ListBox_TO_Name.Value is set to something like "ABC" and ListBox_TO_Number.Value is set to something like "1234". When the values get set properly, the associated click subroutines (e.g., ListBox_TO_Name_Click()) get called automatically when the value is set. The times that it doesn't work, they are both set to "" and the click subroutines do not get called. I also tried

myListbox.Selected(myIndex) = True

View 4 Replies View Related

Small Code Works For One User But Not Another

Oct 5, 2009

This snippet of code works fine when I run it. When another user uses this same workbook and runs it it gives an error:

Sheets("Data").Select
Range("A2").Select
ActiveSheet.Paste
This is the line highlighted by excel:

ActiveSheet.Paste
I have tried changing it to:

Sheets("Data").Paste

View 9 Replies View Related

Activate Workbook Code Only Works On Some PCs

Oct 20, 2007

I wrote code to update some workbooks. The code opens the workbooks and then activates the workbook to add the update.

I was tired when I wrote the code to activate the workbook and it is written:

Workbooks("Update").Activate

The updates have already been sent out and it is not working on some computers. (If I change the code to

Workbooks("Update.xls").Activate

it works fine.)

Is there some option in the VBA editor that I can have people change on their computer so the code will run? Why does it work on some computers and not others?

(Unfortunately, rewriting the code to add ".xls" and resending everything isn't an option.)

View 7 Replies View Related

Code Works In Debug Mode But Will Not Run Through When Played

Mar 13, 2013

I put together about 10 separate macros that will log you into a site using the values in a given cell. I was having trouble with the last one because of AutoComplete remembering the username. So I put in an IF statement, and when I used F8 to go line for line, it works perfectly. However, when I click F5 and just let it play through, it doesn't log in. I tried adding a 5 second delay, but that didn't seem to work. I still get a run-time error when I hit play.

It get hung on this line:

Code:
If doc.getElementById("user_name").Value = cUsername Then

But the complete code is this:

Code:
Sub StreetLinks_Login()
'On Error Resume Next

Dim cURL As String
cURL = Worksheets("Sheet1").Range("B9").Value

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

View 7 Replies View Related

Find Method Code Works Only In Immediate Window

Sep 1, 2006

I am trying to write a function that searches a column for an index then sums the value in a corresponding column. This function works when run in the immediate window of VBA but when I use it in the spreadsheet it can't find any rows.

The reason I need this formula is because there are more than one rows that can be found.

Function SumIndex2(ByVal sField As String, ByVal sIndex As String) As Double

Dim i As Integer
Dim dSum As Double
Dim rng As Range
Dim firstaddress As String

View 5 Replies View Related

VBA Code Works Great Until Number Of Rows Changed

Jan 21, 2014

I wrote the following basic code earlier (which will end up being part of a larger code)

Code:
Dim DateInput As String
Dim LastCell As String

Sub LastRowInputBox()

LastCell = InputBox("What is the last row number in the range?", "Last Row Input")

[Code] ......

As you can see, all the ColumnCopyInsert Subroutine does is copy select/copy four columns (E:H), inserts the copied selection immediately to the right, inserts formulas and autofills down to the last row required. I added the LastRowInputBox routine as the range of rows varies from week to week (inserting new rows, deleting others).

The code works great...up to a point unfortunately. If ran as it is, everything that should be copied/pasted will be and cells autofilled to the row specified via the InputBox. Here comes the problem, if any rows are either inserted or deleted then the code throws out "The object invoked has disconnected from its clients" when it reaches the first instance of the following line:

Code:
Selection.Insert Shift:=xlToRight

At which point, Excel hangs (or maybe in some sort of loop) and I have to open Device Manager and close the Excel exe process.

View 5 Replies View Related

Macro Code Only Works If Specific Worksheet Active

Apr 30, 2008

I have searched the FAQ's but have not found a suitable answer to my problem. I have some code that works perfectly when it is run from the VB Editor but when I put it behind a command button it gives me an error almost straight away. I have read that when a command button is used the command button defaults the active sheet to the one that it is one therefore you always have to specify the active sheet but I have done this so am still confused as to why it is falling over. Below is my code, I have commented where it is tripping:

Sub FormattingAcutalReport()
Workbooks.Open Filename:="H:Risk ReportingDaily TemplatesMF Consolidated Risk DAILY LIVE DATA FROM BO.xls"
Workbooks.Open Filename:="H:Risk ReportingDaily TemplatesDaily Non Banks LIVE.xls"
Dim myBorders() As Variant, item As Variant
Set SEGNSEG = Workbooks("Todays Reports.xls").Worksheets("Seg and Non Seg Bank Summary")............................

View 2 Replies View Related

Code To Find And Offset Works On First Sheet But Won't Loop To Other Sheets

Mar 5, 2009

I have this code attached to a button on the first sheet of a workbook with hundreds of sheets.

it is suposed to look for a cell that contains "SAY:" and then move one column to the right and make it a zero. It works on the first sheet but not on any other sheet.

View 7 Replies View Related

Excel Code Works Fine But Error When Called From Access?

Apr 11, 2012

This code works fine when I run it in Excel.

Code:

Sub RemoveCodeAndSave()
'Remove all code from ThisWorkbook code module
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule.DeleteLines 1, _

[Code]....

I get the error "Run-time error 440: The specified dimension is not valid for the current chart type" why I am getting this. The macro does everything I want it to, except for throwing the error at the end.

View 3 Replies View Related

Journal Ledger Balance

Nov 12, 2009

Ref attached sheet

I m facing a big and urgent problem in my worksheet..i have done my all work here but now i knew that there is a difference in this vb code..

I need your urgent favour to rectify it for me..

What i need is sheet1 is my journal jounal (data) and sheet2 is my reporting place where i set a macro button at top to update the report..

But in sheet2 column I i need an auto Balance of debit & credit..

View 11 Replies View Related

Transfer Data From Journal To Ledger

Nov 18, 2009

how can transefer data from journal to ledgers accounts,

i can do journal and its formulas, ledger as well,

but i dont know how to connect them to avoid entring data 2 times.

View 14 Replies View Related

Converting Excel Sheet Into A Journal

Nov 23, 2011

I have an excel sheet i would like to make into a journal. I would like to make a page for each day of the year. I want to duplex print it, but i cant seem to do it directly from excel would it be possible just to make the file into a pdf?

Here is the macro i was trying:

Sub ghgh()
Dim i As Long, temp As String
temp = InputBox("Enter date")
If Not IsDate(temp) Then Exit Sub
For i = 0 To 2

[Code] ....

Trouble is it only does one page at a time, so i cant duplex print.

View 1 Replies View Related

Extracting Data From Wall Street Journal Using VBA?

Jun 15, 2014

I am trying to create a excel file that takes information off the website (AAPL Annual Income Statement - Apple Inc. Annual Financials) based on a stock name I enter in the first excel sheet. So when I type in the stock name, and click on the Search button (runs the VBA program) i created, it will search on the website for that stock and retrieve the 5 years financial data. How can I incorporate web query function in it?

Sub AddNewWorksheet()
Dim Val As String
Val = Sheets(1).Range("B4").Value
Sheets.Add
ActiveSheet.Name = Val
ActiveSheet.Move after:=Sheets(4)
End Sub

View 7 Replies View Related

Create Instance Of Microsoft Windows Journal

Feb 14, 2008

1) When using the command below, how can I determine what the "XYZ" component could be. I see plenty of examples of it being used to start a MS Word session or Powerpoint but I'd really like to see a definitive list.

At the moment, I'm not even sure what to type into Google that describes this part of the command's argument.

Set target = CreateObject("XYZ.Application")

2) I'm just a frightened noob on this site and I tried to follow the advice on bumping my previous post on this subject, having altered my plea. All I got was a telling-off for being a double-poster and my old old thread sat where it was despite my 'Bump' command. Do you have to have at least one reply before your thread moves?

View 6 Replies View Related

Macro To Transpose Data Into Journal Entry Format

May 4, 2012

Transaction #Transaction DescriptionAccountDate (XX/XX/XX)DesciptionABCDEFG10/24/2015Cash Held(3404.00)3404.00 0.00 0.00 50.00 0.00 (50.00)10/25/20152Cash not Held0.00 (9707.00)9707.00 0.00 (60.00)60.00 0.00 10/26/2015Cash Held0.00 (7402.00)0.00 7402.00 0.00 0.00 0.00 10/27/20154Transfer to Bank 0.04 0.00 (50.04)0.00 50.00 0.00 0.00 10/28/20155Transfer of Cash0.00 4208.00 0.00 (4208.00)0.00 0.00 0.00

I am trying to make a macro that will turn transpose the above data into the below data.

DateDescriptionAccountAmount10/24/2015Cash HeldA-340410/24/2015Cash HeldB340410/24/2015Cash HeldE5010/24/2015Cash HeldG-5010/25/2015#2 Cash not HeldB-970710/25/2015#2 Cash not HeldC970710/25/2015#2 Cash not HeldE-6010/25/2015#2 Cash not HeldF6010/26/2015Cash HeldE-740210/26/2015Cash HeldG7402

Basically each non-zero number in the accounts (A through G) need to have their own row with the account name from their appropriate column and the date and description in their appropriate row. So as you can see each account A,B,E,and G get the amount -3404, 3404, 50, and -50 in their own row and get the appropriate descipion of 'Cash Held' and Date '10/24/2015'. Then the macro would move onto the next row and do the same thing.

Also if there is a way to tack in front of the description the transaction # (if there is one) ie. #2 Cash not Held. I really don't even know where to start.

View 9 Replies View Related

Using Macro To Create Financial Statements From Journal Entries

Jan 8, 2014

I'm completely new with macros. I was wondering what you would need so that the information will automatically update itself onto a summary page. For example for entries on one worksheet to create a statement on another worksheet?

Example:
Asset Type
Description
Date
Amount
OA

[Code]....

The first entry doesn't have a date, because the asset type is classified as OA. (therefore an exception) Each of this information will be linked to it's own worksheet. For example, the OA entries would create their own sheet which will summed.

View 1 Replies View Related

Unzip Code - Works Without Variables, Breaks With Variables...

Feb 5, 2009

Unzip Code - Works without Variables, Breaks with Variables.... This has been driving me bananas...

I have the

View 2 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

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

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







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