Greetings,
I am receiving an application or object defined error on the below line.
h is a range variable, AC is a string, k and b are integers
I am receiving an application or object defined error on the below line.
h is a range variable, AC is a string, k and b are integers
Code:
COM.Worksheets(AC).Range(h, h.End(xlToRight)).Select
Code:
For Each ws In COM.Worksheets
AC = ws.Name
k = Cells(Rows.Count, "A").End(xlUp).Row
Do Until k = 2
If Cells(k, b) <> "" Then
Set h = Cells(k, b)
k = k - 1
Else
COM.Worksheets(AC).Range(h, h.End(xlToRight)).Select
Selection.Copy
COM.Worksheets(AC).Range(Cells(k, b)).PasteSpecial Paste:=xlPasteValues
k = k - 1
End If
Loop