Code Error

shannonja

New Member
Could someone please help me out with this, im pretty green with coding, and the orange part is getting an error, thanks

Sub Empl_Load()
Dim EmpRow As Long
Dim EmpCol As Long
With Sheet1
If .Range("B5").Value = Empty Then
MsgBox "Please enter a valid Employee from the drop down list"
Exit Sub
End If
.Range("B1").Value = True 'Set Employee Load To True
EmpRow = .Range("B5").Value
For EmpCol = 1 To 28
.Range(Sheet2.Cells(1, EmpCol).Value).Value = Sheet2.Cells(EmpRow, EmpCol).Value
Next EmpCol
.Shapes("Group 67").Visible = msoFalse
.Shapes("Group 66").Visible = msoCTrue
.Range("B1").Value = False 'Set Employee Load To False
.Range("B6").Value = False 'Set New Employee To False
Show_EmplPic
End With
End Sub
 

MARK858

Well-known Member
Code:
.Range(Sheet2.Cells(1, EmpCol).Value)
This part is wrong unless you have a range address in Sheet2.Cells(1, EmpCol), on what sheet do you want
Code:
Sheet2.Cells(EmpRow, EmpCol).Value
placed? and what is in
Code:
Sheet2.Cells(1, EmpCol).Value
?

There might be more questions depending what your answers to the 2 questions are.
 

Some videos you may like

This Week's Hot Topics

Top