Last row

E

Edgar

Hi

I have the following code which should import data from a
workbook but the last row reference isnt working.
oWb.Sheets(osh).Range ("A1:AQ" & Range("AQ65536").End
(xlUp).Row)

Can anyone help?

Sub Import_Data()
'Imports data from Fname - Sheet (Select_Sheets) to
Crystal_Table
Application.DisplayAlerts = False
If fname <> "" Then
Range("a1").Value = fname
Set oWb = Workbooks.Open(fname)
oWb.Sheets(osh).Range ("A1:AQ" & Range("AQ65536").End
(xlUp).Row)
Windows("Remittance Module.xls").Activate
Sheets("Crystal_Table").Select
Range("A1").Select
ActiveSheet.Paste
Else
MsgBox ("Please select a Valid File")
End If
oWb.Close
Worksheets("Menu").Activate
Application.DisplayAlerts = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top