View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Jackson Jim Jackson is offline
external usenet poster
 
Posts: 324
Default Help I need a macro or IF Statement

Here is a macro that will do the job.

Sub fill_in()
ActiveSheet.Range("A3").Select
For Each cell In Sheets
Do
If ActiveCell "" Then

ElseIf ActiveCell.Offset(0, 3) "" Then
ActiveCell = ActiveCell.Offset(-1, 0)
ActiveCell.Offset(1, 0).Activate
ElseIf ActiveCell = "" And ActiveCell.Offset(1, 0) = "" Then
Exit For
End If
ActiveCell.Offset(1, 0).Activate
Loop
Next
End Sub
--
Best wishes,

Jim


"Mascot" wrote:

Hi Everyone,

I have a spreadsheet that looks like the one below. You will notice that I
will have an Acct # listed and then it will have Debits & Credits and then it
will list the account and then sub account. The problem is that wherever
there is an Acct. # with more than one account or sub account the Acct. # is
only listed with the first Acct. I need to have this copied down on each
line were there is an Acct. for each Acct. #. Can someone please help me
with this?

ACCT # DEBIT CREDIT ACCT SubAcct.
Z000100RER 100 -200 7001 9999
8001 9999
8100 9999
8500 9999
8600 9999
8700 9999
8800 9999

Z000300RER 300 0 7001 8888
8390 8888

Z000400RER 400 0 7001 7777

Z000500RER 500 -600 7001 5555

Z000600RER 800 -700 7001 4444

Z000700RER 1000 -900 7001 3333

Z100100RER 1200 -1100 1001 0

Z100200RER 1400 -1300 1002 20000

Z100300RER 1600 -1500 1003 0

Z100400RER 1700 1700 1004 0

Z100500RER 1900 -1800 1005 79000

Z505000RER 2000 2000 5050 0
5050 200
5050 201
5050 201
5050 203
5050 001B3
5050 400
5050 HR500
5050 HR501
5050 HR502

Z606000RER 2100 2100 6060 15000

Z606001RER 2200 0 6060 15010

Z606500RER 2300 2300 6065 15020

Z605001RER 2400 -2500 6065 15030

Z606600RER 2600 -2700 6066 15040

Z606601RER 2800 0 6066 15050