Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I struggle to make the offset method to change with the selected case. anyone that can se what am doing wrong? Sub kopi() Dim x As Range Dim y As Range Dim Stilling Dim m As Range Stilling = Sheet1.Range("E3").Value Select Case Stilling Case "Senior Boresjef" Set y = Sheet2.Range("B2:M2") Set m = x.Offset(20, 0) Case "Vedlikeholdsleder" Set y = Sheet2.Range("B14:M14") Set m = x.Offset(8, 0) Case Else MsgBox "Select a job description" End Select For Each x In y If Not IsEmpty(x) Then m.Resize(6, 1).Copy Sheets("Skjema").Select Run "lim" End If Next End Sub Sub lim() Dim rngDestination As Range Set rngDestination = Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) rngDestination.Select Selection.PasteSpecial Paste:=xlValue, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True End Sub -- Copy & paste developer |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
OFFSET PROBLEM | Excel Discussion (Misc queries) | |||
offset problem | Excel Programming | |||
Summing multiple hits using match, offset and index method | Excel Programming | |||
Offset Method and Interpreting Absolutes in Range Objects | Excel Programming | |||
Can I use a defined integer in an OFFSET method? | Excel Programming |