Jump to content
Sign in to follow this  
DCCD

[SOLVED] - Excel macros

Recommended Posts

DCCD

Simple macros in Excel using the macro recorder

Sub Macro()
    Range("a204:i51").Select
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
End Sub

How to do it with AutoIt :D just i can't get ".Weight" And ".ColorIndex" to work!!

With $MyObject.ActiveSheet
    .range("A" & $A & ":i51" ).Borders($xlEdgeBottom).LineStyle = $xlContinuous
    .Weight = $xlThin
    .ColorIndex = $xlAutomatic
EndWith
Edited by DCCD

Share this post


Link to post
Share on other sites
Malkey

Simple macros in Excel using the macro recorder

Sub Macro()
    Range("a204:i51").Select
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
End Sub

How to do it with AutoIt :huh: just i can't get ".Weight" And ".ColorIndex" to work!!

With $MyObject.ActiveSheet
    .range("A" & $A & ":i51" ).Borders($xlEdgeBottom).LineStyle = $xlContinuous
    .Weight = $xlThin
    .ColorIndex = $xlAutomatic
EndWith
Try this.

;
#include <Excel.au3>

Local $oExcel = _ExcelBookNew();Create new book, make it visible
#cs
Sub Macro()
    Range("a204:i51").Select
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThick
        .ColorIndex = xlAutomatic
    End With
End Sub
#ce

Local $A = 204

With $oExcel.ActiveSheet
    .range("A" & $A & ":i51" ).Select
    .range("A" & $A & ":i51" ).Borders($xlEdgeBottom).LineStyle = $xlContinuous
    .range("A" & $A & ":i51" ).Borders($xlEdgeBottom).Weight = $xlThick
    .range("A" & $A & ":i51" ).Borders($xlEdgeBottom).ColorIndex = $xlAutomatic
EndWith
;

Edit: This looks better.

With $oExcel.ActiveSheet.range("A" & $A & ":i51" )
    .Select
    .Borders($xlEdgeBottom).LineStyle = $xlContinuous
    .Borders($xlEdgeBottom).Weight = $xlThick
    .Borders($xlEdgeBottom).ColorIndex = $xlAutomatic
EndWith
Edited by Malkey

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×