🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.database
Article #376

Re: ��̣�excel�����������

#376
From: ��ϵ����*Shiyanʲôʱ�����*5������
Date: Mon, 16 Mar 2009 05:20
78 lines
3894 bytes
���ṩһ����������Ҫ�õ���

���������C1�д洢��������ڣ���=today()�����ʾ��C2�洢ʮ�������ڣ���=toda
y()+10,C3�洢=today����-10

ȡ������ʽ����Ϊa1-a10

��VBE���������´��룺
Sub Macro2()
'ɾ��������ʽ����ԭ�и�ʽ
Worksheets(1).Range("a1:a10").FormatConditions.Delete
'��������Ϊʮ��֮��ĵ�Ԫ��ĸ�ʽ
With Worksheets(1).Range("a1:a10").FormatConditions _
    .Add(xlCellValue, xlGreater, "=$c$2")
    With .Borders
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 6
    End With
    With .Font
        .Bold = True
        .ColorIndex = 3
    End With
End With
'��������Ϊʮ��֮ǰ�ĵ�Ԫ��ĸ�ʽ
With Worksheets(1).Range("a1:a10").FormatConditions _
    .Add(xlCellValue, xlLess, "=$c$3")
    With .Borders
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 12
    End With
    With .Font
        .Bold = True
        .ColorIndex = 8
    End With
End With
'��������Ϊǰ��ʮ��ĵ�Ԫ��ĸ�ʽ
With Worksheets(1).Range("a1:a10").FormatConditions _
    .Add(xlCellValue, xlBetween, "=$c$2", "=$c$3")
    With .Borders
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 9
    End With
    With .Font
        .Bold = True
        .ColorIndex = 4
    End With

End With

End Sub

��F5����֮��

�� �� samhoust (sam) �Ĵ������ᵽ: ��
: �뽨��һ����� A��Ϊ�գ� C��Ϊ���Լ���������ڣ� Ʃ��˵��C1 �� 20009.03.09 2
: 009.004.05�� ������������ʽ�������ã� ��A1��2009.03.09-2009.03.19֮�ڣ� ��ʾΪ
: ��ɫ����2009.03.20-2009.03.31֮����ʾΪ��ɫ�� ��2009.04.01-2009.04.05֮����ʾΪ
: ��ɫ�� ����Ҫ��ô���ڣ� ����C��Ӧ������������ܴﵽ�����Ŀ�ġ� 
: ���ң� ������03.09��03.19֮�ڵ��κ�һ���ڴ����ű? A1��ʾΪ��ɫ�� ��������0
: 3.20���ٴδ����ű��ʱ�� A1����ɫ�Զ�ת��Ϊ��ɫ�� ���ҵ�����4��1���ٴδ�
: ʱ�� A1�Զ���Ϊ��ɫ�� 
: ���ʣ� �������������ı��? 
: �һ���������ʽ����ʱ�䣬 ����������ʱ�����ŵ��Ե�ǰ���ڵĸı���Զ�������ɫ��
: лл�����ߵ�......


--
Hebei
��������Զ��ů�ļ�

qq����ϵ����

��Ʒ����ӭ���� Tea ��

�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 59.78.26.99]
Technical Details
Message-ID: <4f2gXj$b4b@bbs.sjtu.edu.cn>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!news.shec6.edu.cn!SJTU

Show Full Headers
Complete Article Headers
X-Google-Thread: 101948,3467c2b584bbabf0
X-Google-Attributes: gid101948,domainid0,public,usenet
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!news.shec6.edu.cn!SJTU
From: qqlover.bbs@bbs.sjtu.edu.cn (��ϵ����*Shiyanʲôʱ�����*5������)
Newsgroups: cn.bbs.comp.database
Subject: Re: ��̣�excel�����������
Date: 16 Mar 2009 05:20:16 GMT
Organization: ��ˮ˼Դ
Message-ID: <4f2gXj$b4b@bbs.sjtu.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: database/M.1237180509.A
Lines: 78