PDA

Vollständige Version anzeigen : Aktives Tabellenblatt


Kövener
16.01.2014, 08:20
Hallo ich habe ein Problem. Ich habe ein Tabelle mit mehreren Tabellenblättern, jetzt möchte ich das folgendes Modul im aktiven Tabellenblatt ausgeführt wird und nicht nur wie im Beispiel im Tabellenblatt "September 2014
Option Explicit

Const strRange As String = "c7, e7, f7, g7, i7, k7, m7, o7, p7, r7, s7, t7, u7, w7, y7, " & _
"c14, d14, e14, f14, g14, h14, i14, j14, k14, l14, m14, n14, o14, p14, q14, r14, s14, t14, u14, v14, x14, y14, " & _
"c8, e8, f8, g8, i8, k8, m8, o8, p8, r8, s8, t8, u8, w8, y8, " & _
"c15, d15, e15, f15, g15, h15, i15, j15, k15, l15, m15, n15, o15, p15, q15, r15, s15, t15, u15, v15, x15, y15, " & _
"c9, e9, f9, g9, i9, k9, m9, o9, p9, r9, s9, t9, u9, w9, y9, " & _
"c16, d16, e16, f16, g16, h16, i16, j16, k16, l16, m16, n16, o16, p16, q16, r16, s16, t16, u16, v16, x16, y16, " & _
"c10, e10, f10, g10, i10, k10, m10, o10, p10, r10, s10, t10, u10, w10, y10, " & _
"c17, d17, e17, f17, g17, h17, i17, j17, k17, l17, m17, n17, o17, p17, q17, r17, s17, t17, u17, v17, x17, y17, " & _
"c11, e11, f11, g11, i11, k11, m11, o11, p11, r11, s11, t11, u11, w11, y11, " & _
"c18, d18, e18, f18, g18, h18, i18, j18, k18, l18, m18, n18, o18, p18, q18, r18, s18, t18, u18, v18, x18, y18, " & _
"c12, e12, f12, g12, i12, k12, m12, o12, p12, r12, s12, t12, u12, w12, y12, " & _
"c19, d19, e19, f19, g19, h19, i19, j19, k19, l19, m19, n19, o19, p19, q19, r19, s19, t19, u19, v19, x19, y19, " & _
"k39, P39, K55, P55"


Private lngIndex As Long

Sub TAB_action(direction As Integer)

lngIndex = lngIndex + direction
If lngIndex > UBound(Split(strRange, ",")) Then lngIndex = 0
If lngIndex < 0 Then lngIndex = UBound(Split(strRange, ","))
Application.Goto Sheets("September 2014").Range(Split(strRange, ",")(lngIndex)) '
End Sub

Gibt es da eine Lösung

Luschi
16.01.2014, 08:43
Hallo Kövener,

versuch es mal so:Sub TAB_action(direction As Integer)
lngIndex = lngIndex + direction
If lngIndex > UBound(Split(strRange, ",")) Then lngIndex = 0
If lngIndex < 0 Then lngIndex = UBound(Split(strRange, ","))
'Application.Goto Sheets("September 2014").Range(Split(strRange, ",")(lngIndex)) '
ActiveSheet.Range(Split(strRange, ",")(lngIndex)).Select
End SubGruß von Luschi
aus klein-Paris

Kövener
16.01.2014, 08:53
supi, genau das war es!!

Danke!!!!!