Specific table of excel (1 Viewer)

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
Hi
I would like to access a specific table in from Sheet Two with Macro.
How should i write in the red box?
thank you
 

Attachments

  • table.png
    table.png
    19.8 KB · Views: 152

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
kolait,

the argument you've highlighted in your image refers to a RANGE object, and that doesn't actually mean a TABLE on a sheet, but rather it's one of the following options:

1) NAMED RANGE
2) RANGE LITERAL (for example: "A1:F5")

I'm 99% sure I'm right about this, but I've never used a macro in this way so I"d have to test it to be sure.
 

June7

AWF VIP
Local time
Today, 10:34
Joined
Mar 9, 2014
Messages
5,423
Seem to remember dealing with a similar question not too long ago but can't find it. Although table names are listed with range names in name manager, they are treated different than ranges.

I cannot find a single example of ImportExportSpreadsheet referencing Excel table name. Agree with Adam, can't reference Excel table with this command.
 
Last edited:

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
kolait,

the argument you've highlighted in your image refers to a RANGE object, and that doesn't actually mean a TABLE on a sheet, but rather it's one of the following options:

1) NAMED RANGE
2) RANGE LITERAL (for example: "A1:F5")

I'm 99% sure I'm right about this, but I've never used a macro in this way so I"d have to test it to be sure.

Thank you dear friend
I have no problem with names and ranges.
If they are in Sheet 1, they will get into Excel.
I want the range or names to be entered from other sheets, which I don't think
 

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
Seem to remember dealing with a similar question not too long ago but can't find it. Although table names are listed with range names in name manager, they are treated different than ranges.

I cannot find a single example of ImportExportSpreadsheet referencing Excel table name. Agree with Adam, can't reference Excel table with this command.

Hi
Yes that's right
I'm too busy trying to import data from different sheets or send them to different sheets, but I didn't succeed.
 

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
kolait,

this is what i'm talking about....this uses a RANGE LITERAL, not a RANGE OBJECT.

how do you want it modified to do what you need?
 

Attachments

  • example1.xlsx
    8.8 KB · Views: 137
  • example1.accdb
    472 KB · Views: 131

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
kolait,

this is what i'm talking about....this uses a RANGE LITERAL, not a RANGE OBJECT.

how do you want it modified to do what you need?

Thank you dear friend
I was wrong.
I should have named the range from this path in the photo.
Now label any boundaries in any object and write in the macro, the entry and exit will be done
 

Attachments

  • ta.png
    ta.png
    72.5 KB · Views: 202

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
Thank you dear friend
I was wrong.
I should have named the range from this path in the photo.
Now label any boundaries in any object and write in the macro, the entry and exit will be done
so are you saying that you've solved your own problem now that you know what to do?
 

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
so are you saying that you've solved your own problem now that you know what to do?

Yes
Thank you for taking the time.
Now I want to know how to import multiple ranges of Excel into an Access table.
Do I need to create an access table for each range?
And then, with a query, do I get them all in one table or is there another way?
 

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
Now I want to know how to import multiple ranges of Excel into an Access table.
Do I need to create an access table for each range?
if you want to use a macro to import the ranges, I'm guessing you *will* have to throw them to separate tables. however, there is a possibility that either of these two lines of specs in the "range" argument of the macro object would work to import multiple ranges:
Code:
1) "A1:F5";B3:F9";A2:E3", etc...  (seperated by ";" symbols"
2) "A1:F5",B3:F9",A2:E3", etc...  (seperated by "," symbols"
I will not test this for you, as I've done enough already. you can do it yourself. and you might not even need " " (double quotes) around the multiple arguments either. when you import one literal range, it doesn't require quotes.
And then, with a query, do I get them all in one table or is there another way?
this is addressed with what I just said. but if you end up importing ranges into different tables, then yes, a query would be needed to consolidate them all.
 

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
if you want to use a macro to import the ranges, I'm guessing you *will* have to throw them to separate tables. however, there is a possibility that either of these two lines of specs in the "range" argument of the macro object would work to import multiple ranges:
Code:
1) "A1:F5";B3:F9";A2:E3", etc...  (seperated by ";" symbols"
2) "A1:F5",B3:F9",A2:E3", etc...  (seperated by "," symbols"
I will not test this for you, as I've done enough already. you can do it yourself. and you might not even need " " (double quotes) around the multiple arguments either. when you import one literal range, it doesn't require quotes.this is addressed with what I just said. but if you end up importing ranges into different tables, then yes, a query would be needed to consolidate them all.

Thank you very much for taking the time ..
I'll try
 

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
kolait,

if you come back to this thread, I should point out that this:
1) "A1:F5";B3:F9";A2:E3", etc... (seperated by ";" symbols"
is not what I intended to say. if you got things to work, I doubt it was with this. the semicolon is used as a parsing indicator in more advanced languages like java, PHP, and .net stuff. probably C and C++ too. sorry about that! I hope you got it all worked out.
 

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
kolait,

if you come back to this thread, I should point out that this:is not what I intended to say. if you got things to work, I doubt it was with this. the semicolon is used as a parsing indicator in more advanced languages like java, PHP, and .net stuff. probably C and C++ too. sorry about that! I hope you got it all worked out.

Thank you very much for taking my time.
This method did not work.
But today you have succeeded in learning something new.
thank you
 

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
ok, but you haven't told us if you *did* get it solved. did you?
 

kolait

Registered User.
Local time
Today, 23:04
Joined
Oct 11, 2019
Messages
60
ok, but you haven't told us if you *did* get it solved. did you?

Hi
No
I was unable to enter a few different ranges.
I tested all the characters but it didn't.
But the selection of a naming range was correct.
 

vba_php

Forum Troll
Local time
Today, 13:34
Joined
Oct 6, 2019
Messages
2,884
Hi
No
I was unable to enter a few different ranges.
I tested all the characters but it didn't.
But the selection of a naming range was correct.
so do you still want help with it? I or others can run some local tests on our end to see if some other patterns will work.
 

Users who are viewing this thread

Top Bottom