|
-
Oct 12th, 2000, 02:51 PM
#1
Thread Starter
Lively Member
Hi,
I want to place a horizontal line in Excel using VBA.Actually iam working with Excel object in VB.Iam able to insert a vertical line with some code but with other options iam not able to insert horizontal line.Can anyone please help me out with this.
Here is the code for the vertical line
Worksheets("Sheet1").Range("A1:G1").Borders(xlDiagonalUp).Color = RGB(255, 195, 0)
Also i want to insert page numbers in the footer like
Page i of n.
Using VBA can anyone tell me as what code to write to display the page numbers.
I will be very much thankful to you if you can give solution to these.
Thanks
Regards
Anil
-
Oct 12th, 2000, 11:54 PM
#2
Addicted Member
Hi anilgoje !!!
Hope this helps.
The example below tested in EXCEL 97 !
One Hint, if you use the macro recorder, much of your work
is already done.
-cu TheOnly
'select the worksheet
With Worksheets("sheet1")
'select the range we want to use
With .Range("a1:g1,a1:a10")
'Note: if you use thin lines for the borders
' somtimes the doesn't appear in the sheet
' change to the preview window - then you can
' see it !!!
'top border line
With .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThick
.Color = RGB(255, 195, 0)
End With
'left border line
With .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThick
.Color = RGB(255, 195, 0)
End With
End With
'setup footer
'see excel help
.PageSetup.LeftFooter = "Sheet &P of " & " &N"
End With
-
Oct 13th, 2000, 09:26 AM
#3
Thread Starter
Lively Member
Thanks Alot!!!! The Only
Thanks Alot!!! TheOnly..
You gave me exactly what i want.Now it is working nicely.Thank you very much for your support.I appreciate you very much.
Once again....Thanks alot..The Only
Regards
Anil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|