I am trying to create a utility that will execute my code until the first blank cell in Column 1. The rows are dynamic and I have a marker cell that will move with the Header Column. I have concept code right now to test that it will actually work and when I run the code nothing is happening not even an error. When I step into the code it is stating all my declared variables are Empty:
I would love if someone can see why the code is not doing anything.
Thank you
Code:
Sub IPutil()
Dim LastRow As Long
Dim LastColumn As Long
Dim StartCell As Range
Dim frow, lrow, fcol, lcol As Integer
Dim rng, MyCell As Range
Dim dcc As Integer
''''Gets StartCell Column
fcol = ThisWorkbook.Worksheets("Internal_Providers").Cells(1, Columns.Count).End(xlToLeft).Column
frow = ThisWorkbook.Worksheets("Internal_Providers").Cells(Rows.Count, 25).End(xlUp).Row
'''''Gets first blank cell on Internal Prov Export Sheet
dcb = ThisWorkbook.Worksheets("INTERNAL_PROV_EXPORT").Cells(Rows.Count, 2).End(xlUp).Row
''''Gets StartCell Row
Set StartCell = ThisWorkbook.Worksheets("Internal_Providers").Cells(frow + 1, fcol)
'Find Last Row and Column
LastRow = ThisWorkbook.Worksheets("Internal_Providers").Cells(ThisWorkbook.Worksheets("Internal_Providers").Rows.Count, StartCell.Column).End(xlUp).Row
LastColumn = ThisWorkbook.Worksheets("Internal_Providers").Range("A" & frow).End(xlToRight).Column
'Select Range
Set rng = ThisWorkbook.Worksheets("Internal_Providers").Range(StartCell, ThisWorkbook.Worksheets("Internal_Providers").Cells(LastRow, LastColumn))
For Each MyCell In rng
If MyCell <> "" Then
v1 = MyCell.Row
ThisWorkbook.Worksheets("INTERNAL_PROV_EXPORT").Cells(dcb + 1, 2).Value = ThisWorkbook.Worksheets("Internal_Providers").Cells(v1, 2).Value
End If
Next MyCell
End Sub
Thank you