Warme bakkertje
Meubilair
- Lid geworden
- 13 apr 2008
- Berichten
- 7.971
- Besturingssysteem
- Windows 10
- Office versie
- MO Home and Business 2024
Dat hij slechts kleurt naar links is correct. Heb 'm zelf nog niet getest in XL2007, zal straks eens proberen.
Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Privacywetgeving
Het is bij Helpmij.nl niet toegestaan om persoonsgegevens in een voorbeeld te plaatsen. Alle voorbeelden die persoonsgegevens bevatten zullen zonder opgaaf van reden verwijderd worden. In de vraag zal specifiek vermeld moeten worden dat het om fictieve namen gaat.
Rudi in xl2007 en ook 2010 loopt het fout in 2010 loopt het hiet foutDat hij slechts kleurt naar links is correct. Heb 'm zelf nog niet getest in XL2007, zal straks eens proberen.
.Line.Visible = msoFalse
.Left = 0
.Width = cl.Left + cl.Width
.Top = cl.Top
.Height = cl.Height
Sub Draadkruis_aanmaken()
Dim shp As Shape, cl As Range, t%
With ActiveSheet
MaakShape "Draadkruis_Horizontaal"
.Shapes("Draadkruis_Horizontaal").Select
With Selection.ShapeRange
.Left = 0
.Width = ActiveCell.Left + ActiveCell.Width
.Top = ActiveCell.Top + ActiveCell.Height
.Height = ActiveCell.Height
End With
MaakShape "Draadkruis_Vertikaal"
.Shapes("Draadkruis_Vertikaal").Select
With Selection.ShapeRange
.Left = ActiveCell.Left
.Width = ActiveCell.Width
.Top = 0
.Height = ActiveCell.Top + ActiveCell.Height
End With
ActiveCell.Select
End With
End Sub
Sub MaakShape(naam As String)
'deze macro kijkt of er een bepaalde shape bestaat, zoniet maakt ze die aan
If naam = "" Then MsgBox "foute naam ": Exit Sub
Dim shp As Shape
With ActiveSheet
On Error Resume Next
Set shp = .Shapes(naam) 'probeer gevraagde shape aan te roepen
If Not shp Is Nothing Then Exit Sub 'gevraagde shape bestaat, dus OK
.Shapes.AddShape(msoShapeRectangle, 0, 0, 0, 0).Select 'maak een nieuwe shape aan
With Selection
.Name = naam 'benoem die met gewenste naam
With .ShapeRange 'vanaf hier gewenste kenmerken aanmaken
With .Fill
.Visible = msoTrue
.ForeColor.SchemeColor = 6 'pas deze aan als je een andere kleur wilt hebben
.Transparency = 0.5 '<- pas deze aan als je de transparantie hoger of lager wilt hebben
End With
.Line.Visible = msoFalse
.Left = 1
.Width = 1
.Top = 1
.Height = 1
End With
End With
End With
End Sub
Sub Draadkruis_aanmaken()
Dim shp As Shape, Zoomperc As Double, ScrollRij As Long, Scrollkolom As Integer, AC As Range, TL As Range
With ActiveSheet
Set AC = ActiveCell 'huidige cel
ScrollRij = Application.ActiveWindow.ScrollRow 'rij van cel bovenaan links
Scrollkolom = Application.ActiveWindow.ScrollColumn 'kolom van cel bovenaan links
Set TL = Cells(ScrollRij, Scrollkolom) 'cel linksboven van dit scherm
With Application
.ScreenUpdating = False 'scherm bevriezen
.EnableEvents = False 'events uitschakelen
End With
Zoomperc = ActiveWindow.Zoom 'huidig zoompercentage
If Zoomperc <> 100 Then ActiveWindow.Zoom = 100 'zet zoom op 100
MaakShape "Draadkruis_Horizontaal" 'kijk of horizontaal draadkruis bestaat, zoniet aanmaken
With .Shapes("Draadkruis_Horizontaal") 'aanpassen horizontaal draadkruis
.Visible = True
.Select
With Selection.ShapeRange
[COLOR="black"][COLOR="red"][B] .Left = 0 'TL.Left 'links=links van toplinks-cel
.Width = AC.Left ' - TL.Left 'ruim kiezen voor het geval je zou zoomen naar bv 25[/B][/COLOR][/COLOR]%
.Top = ActiveCell.Top 'top=top van huidige cel
.Height = ActiveCell.Height 'hoogte=hoogte huidige cel
End With
End With
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.