|
|
Subject:
GETTING NUMBERS TO NEXT FREE LINE
Category: Computers > Programming Asked by: leetim-ga List Price: $5.00 |
Posted:
23 Aug 2004 12:35 PDT
Expires: 26 Aug 2004 18:13 PDT Question ID: 391479 |
I have a trial balance on sheet1 and a profit and loss on sheet2. I can move the numbers on to sheet 2 using a sub(), but I have to use a designated cell viz s1!a2=s2!a2, but where s1a2 is empty, I dont want a profit and loss with a whole lot of zeros. One solution would be to post all and then make a macro to delete ety numvals, but I would rather post it straight using a loop with a next or skip to post the next account with a numval to the next line. Any idea of how I could go about it please | |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: GETTING NUMBERS TO NEXT FREE LINE
From: dreamboat-ga on 23 Aug 2004 20:34 PDT |
Try this: If Sheets(SheetName).Range(YourRange) = vbNullString Then 'Skip This one Else 'Code Here to do what you want End If |
Subject:
Re: GETTING NUMBERS TO NEXT FREE LINE
From: leetim-ga on 24 Aug 2004 07:54 PDT |
I have not tried that yet Dreamboat as it is late and just come in, but looking at it - it skips the null okay (lets say b2) but then for c2 with a value, where do I put this to? I mean it must go on s2b2 now, because there is nothing posted to s2b2, but how can I tell it to go there when I dont know which cells are going to have null values or not. See the trial balance changes from one client to another. What I am looking for is the code to post the s1c2 to 'the next free line on s2' if you see what I mean? If you dont think that is possible, I will have to make a work around with a template profit and loss account to have posted to in null values, and then a macro to delete all lines with a 0. But the post to next line would be preferable. Thanks a lot. |
Subject:
Re: GETTING NUMBERS TO NEXT FREE LINE
From: dreamboat-ga on 24 Aug 2004 13:25 PDT |
Working on it for you. :) |
Subject:
Re: GETTING NUMBERS TO NEXT FREE LINE
From: dreamboat-ga on 24 Aug 2004 16:46 PDT |
If Sheets("Sheet1").Range("A1") = vbNullString Then 'Skip This one Else Sheets("Sheet2").Range("A1").Value = Sheets("Sheet1").Range("A1").Value End If Or with a loop Option Explicit Sub Test() Dim Cell As Range For Each Cell In Sheets("Sheet1").UsedRange If Sheets("Sheet1").Range(Cell.Address).Value = vbNullString Then 'Skip Else Sheets("Sheet2").Range(Cell.Address).Value = _ Sheets("Sheet1").Range(Cell.Address).Value End If Next End Sub It sounds to me like you could use some VBA Training and Certification. :) |
Subject:
Re: GETTING NUMBERS TO NEXT FREE LINE
From: leetim-ga on 25 Aug 2004 01:02 PDT |
Sure could use some training Dreamboat - been on 2 intermediate excel courses at Canning College 2hrs by 8 weeks each, and have the basics. Unfortunately they dont offer programming per se - more in line with macros and worksheet functions. But have the rudiments. These questions I am asking are TOUGH. I am a ball of fire with dbase III+ programming and have a gen ledger prog we use ALL the time in the practice. Running on win98se am still in the ballgame, but I can see the day when I will HAVE to upgrade to XP for internet. A lot of our work is with thin clients now, and you need java jive to get there! My clerk was good too. You ought to see the conversion prog we have for the gen ledger. Drop down menus, button macros and all the like. We got everything done, bar the wretched transfer to profit and loss from cashbook. He ran out of steam and has left to go back to his country of origin. All I have to do is conquer this, and with your help, one way or another I will come up with it. With prog real life situations are the only way to go. Employed comp science grads straight out of univ, but the dont know. Passed the exams, but ask the to write a real life prog - no hope. I dont have to tell you this - you know it better than me. Will put your fine advice to work tonight and thanks SO much for your help |
Subject:
Re: GETTING NUMBERS TO NEXT FREE LINE
From: dreamboat-ga on 26 Aug 2004 00:37 PDT |
You can find Excel VBA Training and Certification will be available any day now (gee, how do I know that?? hee hee) at www.vbaexpress.com/forum. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |