ianfrancis56
New Member
- Joined
- Aug 10, 2011
- Messages
- 34
All,
I am new to the forum and relative new to VBA for excel. I am trying to populate a table based off of another table. The source table has labor categories in column G and, potentially, a cost figure in column Q. I want to check to see if there is a cost figure for each labor category and, if so, populate the second table with the labor category, but skip over it if there is no cost figure. I am probably way off, but it seems with this code I either get all or nothing. Thanks for any help!
Sub PEOFTECalc_Click()
Dim i%, LabCatCount%
LabCatCount = IsEmpty(Sheets("Labor").Range("Q" & i + 4))
For i = 1 To 31
If LabCatCount = True Then
Range("G" & i + 12) = Sheets("Labor").Range("G" & i + 4)
End If
Next i
End Sub
I am new to the forum and relative new to VBA for excel. I am trying to populate a table based off of another table. The source table has labor categories in column G and, potentially, a cost figure in column Q. I want to check to see if there is a cost figure for each labor category and, if so, populate the second table with the labor category, but skip over it if there is no cost figure. I am probably way off, but it seems with this code I either get all or nothing. Thanks for any help!
Sub PEOFTECalc_Click()
Dim i%, LabCatCount%
LabCatCount = IsEmpty(Sheets("Labor").Range("Q" & i + 4))
For i = 1 To 31
If LabCatCount = True Then
Range("G" & i + 12) = Sheets("Labor").Range("G" & i + 4)
End If
Next i
End Sub