Ik wil in macro-1 een variabele declareren. In deze macro-1 wordt macro-2 aangeroepen waarin ik de gedeclareerde variabele van macro-1 wil gaan gebruiken.
Code:
Sub AIB()
ccode = "AIB-"
ActiveCell.Range("A1:C1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ActiveCell.Offset(0, 1).Range("A1").Select
With Selection.Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
End With
Application.Run "xCursus"
ActiveCell.Offset(1, -1).Range("A1").Select
End Sub
======================
Sub xCursus()
Dim code As String
Dim ccode As String
myX = 5500
myY = 3000
code = InputBox("Geef cursucode?" & vbCrLf & vbCrLf & "Wat is de cursus_omschrijving", _
"Cursus_omschrijving", , myX, myY)
ActiveCell.FormulaR1C1 = ccode & code 'Dit werkt dus niet.... :-(
End Sub