Hej Excelent! Koden virker perfekt. Jeg har imidlertid forsøgt at udbygge den ved at kopiere koden serielt, men det fungerer ikke. Jeg har indkopieret koden nedenfor. Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("G41")) Is Nothing Then Exit Sub If Target.Value = "2" Then Sheets("Fotos").Rows("19:34").RowHeight = 14.25 If Target.Value <> "2" Then Sheets("Fotos").Rows("19:34").RowHeight = 0 If Intersect(Target, Range("H41")) Is Nothing Then Exit Sub If Target.Value = "3" Then Sheets("Fotos").Rows("35:50").RowHeight = 14.25 If Target.Value <> "3" Then Sheets("Fotos").Rows("35:50").RowHeight = 0 If Intersect(Target, Range("I41")) Is Nothing Then Exit Sub If Target.Value = "4" Then Sheets("Fotos").Rows("51:66").RowHeight = 14.25 If Target.Value <> "4" Then Sheets("Fotos").Rows("51:66").RowHeight = 0 If Intersect(Target, Range("J41")) Is Nothing Then Exit Sub If Target.Value = "5" Then Sheets("Fotos").Rows("67:82").RowHeight = 14.25 If Target.Value <> "5" Then Sheets("Fotos").Rows("67:82").RowHeight = 0 If Intersect(Target, Range("K41")) Is Nothing Then Exit Sub If Target.Value = "6" Then Sheets("Fotos").Rows("83:98").RowHeight = 14.25 If Target.Value <> "6" Then Sheets("Fotos").Rows("83:98").RowHeight = 0 If Intersect(Target, Range("L41")) Is Nothing Then Exit Sub If Target.Value = "7" Then Sheets("Fotos").Rows("99:114").RowHeight = 14.25 If Target.Value <> "7" Then Sheets("Fotos").Rows("99:114").RowHeight = 0 If Intersect(Target, Range("M41")) Is Nothing Then Exit Sub If Target.Value = "8" Then Sheets("Fotos").Rows("115:130").RowHeight = 14.25 If Target.Value <> "8" Then Sheets("Fotos").Rows("115:130").RowHeight = 0 If Intersect(Target, Range("N41")) Is Nothing Then Exit Sub If Target.Value = "9" Then Sheets("Fotos").Rows("131:146").RowHeight = 14.25 If Target.Value <> "9" Then Sheets("Fotos").Rows("131:146").RowHeight = 0 If Intersect(Target, Range("O41")) Is Nothing Then Exit Sub If Target.Value = "10" Then Sheets("Fotos").Rows("147:162").RowHeight = 14.25 If Target.Value <> "10" Then Sheets("Fotos").Rows("147:162").RowHeight = 0 If Intersect(Target, Range("P41")) Is Nothing Then Exit Sub If Target.Value = "11" Then Sheets("Fotos").Rows("163:178").RowHeight = 14.25 If Target.Value <> "11" Then Sheets("Fotos").Rows("163:178").RowHeight = 0 If Intersect(Target, Range("Q41")) Is Nothing Then Exit Sub If Target.Value = "12" Then Sheets("Fotos").Rows("179:194").RowHeight = 14.25 If Target.Value <> "12" Then Sheets("Fotos").Rows("179:194").RowHeight = 0 If Intersect(Target, Range("R41")) Is Nothing Then Exit Sub If Target.Value = "13" Then Sheets("Fotos").Rows("195:210").RowHeight = 14.25 If Target.Value <> "13" Then Sheets("Fotos").Rows("195:210").RowHeight = 0 If Intersect(Target, Range("S41")) Is Nothing Then Exit Sub If Target.Value = "14" Then Sheets("Fotos").Rows("211:226").RowHeight = 14.25 If Target.Value <> "14" Then Sheets("Fotos").Rows("211:226").RowHeight = 0 If Intersect(Target, Range("T41")) Is Nothing Then Exit Sub If Target.Value = "15" Then Sheets("Fotos").Rows("227:242").RowHeight = 14.25 If Target.Value <> "15" Then Sheets("Fotos").Rows("227:242").RowHeight = 0 If Intersect(Target, Range("G41")) Is Nothing Then Exit Sub If Target.Value = "2" Then Sheets("Eftersynsdata").Rows("22:27").RowHeight = 14.25 If Target.Value <> "2" Then Sheets("Eftersynsdata").Rows("22:27").RowHeight = 0 End Sub
------------- Mvh. PI / Excel 2010
|