Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Hello

Wow! That's much more complicated than I expected. Thank you very much for
your help. It will take me awhile to play w/ this and figure it out. I'll let
you know how it goes. Thanks again!
Kind regards,
John

"JW" wrote:

On Oct 15, 10:01 pm, hjburk wrote:
Hi folks,
I'm trying to create a heavily modified accounts receivable aging report. I
think an example will help explain my intent.

CUSTOMER DATE "DESCRIPTION" 0-30 31-60 61-90 90+

Microsoft 10/15/07 Computer Monitor X
Boeing 9/1/07 Radio Equip. X

What I would like this to do is, have the "X" automatically move laterally
from column to column as time passes from the date entered in column B.

Thank you very much for your help. Kind regards, John


Assuming that your worksheet is formatted like your example, place
something like the code below in the ThisWorkbook module of the
applicable workbook. This will cycle through the sheet and make the
necessary adjustment each time the workbook is opened. Is this what
you are after?

Private Sub Workbook_Open()
Dim dateCol As String
dateCol = "B"
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(i, 4), Cells(i, 7)).ClearContents
With Cells(i, dateCol)
If .Value <= Date And _
.Value = Date - 30 Then
Cells(i, 4).Value = "X"
ElseIf .Value <= Date - 31 And _
.Value = Date - 60 Then
Cells(i, 5).Value = "X"
ElseIf .Value <= Date - 61 And _
.Value = Date - 90 Then
Cells(i, 6).Value = "X"
Else
Cells(i, 7).Value = "X"
End If
End With
Next i
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"