Flora Edwards
asked on
VBA modification help needed from earlier solution (VBA to modification to take it from table instead of sheet)
I had this question after viewing VBA to modification to take it from table instead of sheet.
How can i modify the code in my earlier question, that if the source worksheet has a table then take data from table
If sheets(1) does not have a table then use the code below
How can i modify the code in my earlier question, that if the source worksheet has a table then take data from table
'Copy Data From Source Workbook
Set SourceWs = SourceWB.Sheets(1)
Set CopyRng = SourceWs.ListObjects(1).Range
If sheets(1) does not have a table then use the code below
Set SourceWs = SourceWB.Sheets(1)
SourceLR = SourceWs.Range("A2").SpecialCells(xlCellTypeLastCell).Row
SourceLC = SourceWs.Range("A2").SpecialCells(xlCellTypeLastCell).Column
Set CopyRng = SourceWs.Range(SourceWs.Range("A2"), SourceWs.Cells(SourceLR, SourceLC))
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear Norie and Rgonzo1971
somehow the ListObject(1).Range does not work. i posted a new question here https://www.experts-exchange.com/questions/29070714/VBA-Import-frm-TBL-does-not-work-earlier-helped-by-Norie-and-Rgonzo1971.html
somehow the ListObject(1).Range does not work. i posted a new question here https://www.experts-exchange.com/questions/29070714/VBA-Import-frm-TBL-does-not-work-earlier-helped-by-Norie-and-Rgonzo1971.html
Flora
How does it not work?
How does it not work?
ASKER
Thanks Norie.
it works now. it did not work because there was a hidden sheet.
it works now. it did not work because there was a hidden sheet.
ASKER
very much appreciated! you guys saved me a lot of time. it is really magical. i am so happy!