Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code to format cells in Excel
Message
From
06/02/2009 07:33:42
 
 
To
05/02/2009 15:07:30
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Miscellaneous
Thread ID:
01379609
Message ID:
01379750
Views:
26
assuming your excel object is called oExcel


with oExcel
.Range("A57:B57").Select()
With .Selection
.HorizontalAlignment = xlCenterAcrossSelection
.VerticalAlignment = -4107
.WrapText =. F.
.Orientation = 0
.AddIndent = .f.
.IndentLevel = 0
.ShrinkToFit =.F.
.ReadingOrder = -5002
.MergeCells = .F.
End With

Endwith







>Hello,
>
>I am attempting to format a cell in Excel using the following macro:
>
>Sub Macro1()
>'
>' Macro1 Macro
>' Macro recorded 2/5/2009 by Martha Kroll
>'
>
>'
> Range("A57:B57").Select &&This needs to reference (m.rownbr,1)
> With Selection
> .HorizontalAlignment = xlCenterAcrossSelection
> .VerticalAlignment = xlBottom
> .WrapText = False
> .Orientation = 0
> .AddIndent = False
> .IndentLevel = 0
> .ShrinkToFit = False
> .ReadingOrder = xlContext
> .MergeCells = False
> End With
>End Sub
>
>Obviously this doesn't work if I just copy & paste it into my code. Any suggestions as to how to make this work are greatly appreciated.
>
>Thanks,
>Martha
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform