Trying to pull data out of a spreadsheet and I am getting this error "Doesn't support this property or method" for line F1=ActiveWorkbook.ActiveSheet.
I've used something very similar to this before. Any idea what I am missing?
How can I define the array for F1? Is it needed?
Sub PullManualBatchData()
lastrow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
'Dim F1 As Object
Dim Ary1(3, 1) As String
F1 = ActiveWorkbook.ActiveSheet
F1.Activate
'h = FreeFile
'Open File1 For Input As #h
g = 0
For x = 1 To lastrow
data = F1.Cells(x, 1)
If data <> "" Then Ary1(g, 1) = data And g = g + 1
Next
'Loop
'ThisWorkbook.Activate
Workbook_Open
End Sub
I've used something very similar to this before. Any idea what I am missing?
How can I define the array for F1? Is it needed?
Sub PullManualBatchData()
lastrow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
'Dim F1 As Object
Dim Ary1(3, 1) As String
F1 = ActiveWorkbook.ActiveSheet
F1.Activate
'h = FreeFile
'Open File1 For Input As #h
g = 0
For x = 1 To lastrow
data = F1.Cells(x, 1)
If data <> "" Then Ary1(g, 1) = data And g = g + 1
Next
'Loop
'ThisWorkbook.Activate
Workbook_Open
End Sub