I'm doing something wrong and can't figure it out.
I have several macros that copy and past data to 2 different worksheets. Recent changes require that I give the users a selection option for which worksheet the data gets copied to.
I have a control toolbox combobox as the reference selection in the VBA code to decide which worksheet the data should go to.
I have cell L55 as the linked cell.
I thought I would be able to refer to the value in L55 Linked cell as the reference for which sheet to copy the data to. When I F8 through the code the cursor jumps to the first IF statement, end if, then the second if, then to end if. It's not throwing an error though.
I have several macros that copy and past data to 2 different worksheets. Recent changes require that I give the users a selection option for which worksheet the data gets copied to.
I have a control toolbox combobox as the reference selection in the VBA code to decide which worksheet the data should go to.
I have cell L55 as the linked cell.
I thought I would be able to refer to the value in L55 Linked cell as the reference for which sheet to copy the data to. When I F8 through the code the cursor jumps to the first IF statement, end if, then the second if, then to end if. It's not throwing an error though.
If (L55") =" data" Then
Range("b7:E31").Select
Selection.Copy
Sheets("Data_Sheet").Select
Range("a7").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("sheet1").Select
Range("j2").Select
Application.ScreenUpdating = True
MsgBox "Data Copied to data_sheet"
End If
If ("L55") = "compare" Then
Range("b7:B31,e7:e31").Select
Selection.Copy
Sheets("CFM_Compare").Select
Range("a4").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("sheet1").Select
Range("j2").Select
Application.ScreenUpdating = True
MsgBox "Data Copied Compare Sheet"
End sub
Last edited: