Jump to content

[SOLVED] - Excel macros


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...