Windows 10 and not working macro

AlesD6

New Member
Joined
Jul 15, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I have this macro long time and still works on Windows7 and Office 365 but now I get new notebook with Windows 10 and Office 365 and only this macro doesn´t working and show me this error about private function. Can somebody help me?

Runtime error 1004 (something about weight border)

macro stopped on: .Weight = xlThick

VBA Code:
Private Function doubleLine(aktRange)

    Range(aktRange).Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlDouble
        .ThemeColor = 1
        .TintAndShade = -0.499984740745262
      [COLOR=rgb(250, 197, 28)]  .Weight = xlThick[/COLOR]
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlDouble
        .ThemeColor = 1
        .TintAndShade = -0.499984740745262
        .Weight = xlThick
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlDouble
        .ThemeColor = 1
        .TintAndShade = -0.499984740745262
        .Weight = xlThick
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlDouble
        .ThemeColor = 1
        .TintAndShade = -0.499984740745262
        .Weight = xlThick
    End With
End Function
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

daverunt

Well-known Member
Joined
Jul 9, 2009
Messages
1,908
Office Version
  1. 2013
Platform
  1. Windows
Hi,

I don't have Windows 10 but try recording a macro and setting those borders manually on a range of cells. That should give you the code you need.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,990
Messages
5,834,743
Members
430,315
Latest member
bobh63

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top