Results 1 to 3 of 3
  1. #1
    Luca87itc is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    2

    Exclamation Vba Code delete&shift up cells- Access 2007

    Hello, it's the first time I write here.


    I have a problem with Access 2007.
    I am not a VBA-expert, so you can better understand my difficulties.
    I am trying to create, in access, a report based on excel documents. Once it will be finished, the report should display specific cells of any excel documents imported into access.
    My actual problem concerns a filtered table I have created in access: I should produce the command (very simple in Excel) to delete a cell in a column and shift up all the cells in the same column. after, I should create text boxes, taking only certain cells from the table, and displaying their contents into the report.
    Now, how can I do? Do you know which is the VBA code to delete and shift up in Access?

    Thanks

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    MS Access is not Excel, and does not work like Excel. Access does not deal with cells, rows and columns the way Excel does. In Access, rows represent records in a table (or query), and columns represent fields in those records. You cannot delete a "cell" in Access (there is no such object as a "cell" in Access) and move other cells in a column up, because "delete" in MS Access refers only to complete records, not individual fields. You can delete the contents of a "cell", but not the "cell" itself.

    I suppose you could write VBA code to accomplish what you are trying to do - but it would not be simple.

    What do you mean when you say "the report will display specific cells"? Although Access can refer to specific cells of a worksheet, it is not trivial for beginners. Can you give more details?

  3. #3
    Luca87itc is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    2
    HI,
    actually I have solved deciding to do everything in excel and then importing the filtered and correct (with delete&shift) table in access.
    It is definitely the easier way.
    Thanks for the answer anyway.
    Now I have only the latest problem.
    I have made a report based on a sample excel file. I have built around 50 queries to make the process easier to modify later on; the fact is that the report is supposed to be a template for 100 excel files (with the same structure of course). Which is the VBA-code that allows me to replicate all the queries I have made for the report?
    basically I need to automate the process in order to have a report that shows me the content of every excel file.
    Maybe I have not been so clear

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 11-22-2011, 09:10 PM
  2. Delete cells <= 2 letter values
    By melting in forum Access
    Replies: 5
    Last Post: 05-14-2011, 07:47 PM
  3. VB Code in Access 2007
    By collen in forum Programming
    Replies: 1
    Last Post: 10-12-2010, 06:27 AM
  4. Access 2003 code vs Access 2007 Code
    By ralphjramirez in forum Access
    Replies: 5
    Last Post: 11-23-2009, 12:33 PM
  5. Access 2000 and 2007 VB code
    By gnuman in forum Access
    Replies: 0
    Last Post: 08-26-2009, 05:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums