JaccoVis90
New Member
- Joined
- Oct 30, 2015
- Messages
- 34
Hey all,
I have a question about my VBA project
I copied in a large Range ("Lamp") = GO200:TY340 multiple times with an offset each time. All goes fine here. But every next line that uses a kind of selection returns to an error. (so wsb.Range("A1").select = errorline)
If i remove this line then the errorline goed to: wsb.Range("A2:A3").AutoFill Destination:=Range("A2:A98"), Type:=xlFillDefault
I can solve this error to pause the macro, scoll up/down in the sheet en continu the VBA. You can visualy see that the selection is in a L shape en returns to a square after scrolling in the window. Is there a way to fix it?
i try to use .select minimal
Dim en sets are correct
I have a question about my VBA project
I copied in a large Range ("Lamp") = GO200:TY340 multiple times with an offset each time. All goes fine here. But every next line that uses a kind of selection returns to an error. (so wsb.Range("A1").select = errorline)
If i remove this line then the errorline goed to: wsb.Range("A2:A3").AutoFill Destination:=Range("A2:A98"), Type:=xlFillDefault
I can solve this error to pause the macro, scoll up/down in the sheet en continu the VBA. You can visualy see that the selection is in a L shape en returns to a square after scrolling in the window. Is there a way to fix it?
i try to use .select minimal
Dim en sets are correct
Code:
berekening.Range("Lamp").Copy
wsb.Range("B2").PasteSpecial (xlPasteValuesAndNumberFormats)
berekening.Range("Lamp").Offset(0, Hschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(0, -Hschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(0, Hschuif + Hschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(0, -Hschuif - Hschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(-Vschuif, HVSschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(-Vschuif, -HVSschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(-Vschuif, Hschuif + HVSschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
berekening.Range("Lamp").Offset(-Vschuif, -HVSschuif - Hschuif).Copy
wsb.Range("B2").PasteSpecial Operation:=xlPasteSpecialOperationAdd
wsb.Range("A1").Select
Application.CutCopyMode = False
Set Slack = wsb.Range("B2:QC195")
Application.ScreenUpdating = False
wsb.Columns("B:QD").ColumnWidth = 2.14
Slack.FormatConditions.AddColorScale ColorScaleType:=2
Slack.FormatConditions(1).ColorScaleCriteria(1).Type = _
xlConditionValueNumber
Slack.FormatConditions(1).ColorScaleCriteria(1).Value = 0
With Slack.FormatConditions(1).ColorScaleCriteria(1).FormatColor
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.149998474074526
End With
Slack.FormatConditions(1).ColorScaleCriteria(2).Type = _
xlConditionValueNumber
Slack.FormatConditions(1).ColorScaleCriteria(2).Value = 200
With Slack.FormatConditions(1).ColorScaleCriteria(2).FormatColor
.Color = 65535
.TintAndShade = 0
End With
With Selection.Font
.Name = "Calibri"
.Size = 11
End With
Slack.NumberFormat = "0"
Application.ScreenUpdating = True
wsb.Range("A2").Value = -120
wsb.Range("A3").Value = -115
wsb.Range("B1").Value = -870
wsb.Range("C1").Value = -865
wsb.Range("A2:A3").AutoFill Destination:=Range("A2:A98"), Type:=xlFillDefault
wsb.Range("B1:C1").AutoFill Destination:=Range("B1:ML1"), Type:=xlFillDefault