+ Reply to Thread
Results 1 to 11 of 11

Macro or code fetch the data from database and update the database if correction made

  1. #1
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Macro or code fetch the data from database and update the database if correction made

    Hi all,


    I have one excel file where there is a database sheet where the details are there and other sheet is there that is invoice format. i want ot fetch data from database if i put the serial number that is unique one then data has to be shown in invoice format and if any changes we made in invoice then it has be updated in database.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Macro or code fetch the data from database and update the database if correction made

    1) To DataBase sheet code module
    Please Login or Register  to view this content.
    2) To Invoice sheet code module
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Re: Macro or code fetch the data from database and update the database if correction made

    Thanks a lot it works.
    but it lags while clicking on invoice sheet.
    is it possible to give a button so that user can click on that button and it will get updated
    since the database sheet has a huge amt of data.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Macro or code fetch the data from database and update the database if correction made

    It must be other factor.
    It is not doing something to take time.

    Try add Application.Calculation = xlManual and set back to xlAutomatic.

  5. #5
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Re: Macro or code fetch the data from database and update the database if correction made

    Try add Application.Calculation = xlManual and set back to xlAutomatic.

    where to add this

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Macro or code fetch the data from database and update the database if correction made

    ... So, you don't understand the code at all...
    Please Login or Register  to view this content.
    Last edited by jindon; 02-21-2019 at 03:05 AM.

  7. #7
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Re: Macro or code fetch the data from database and update the database if correction made

    Yes Sir i dont understand coding at all
    i m total lay man for coding
    as u mentioned the code i tried but it doesnt update at all
    after adding xl manual and xl update it give message for debug
    in first line option explicit

  8. #8
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Re: Macro or code fetch the data from database and update the database if correction made

    hi Jindon,

    As u said ther is no lag while using this code.

    Actually i checked in 2013 it was lagging means its getting slow
    and in 2016 its work fine smoothly.
    can u suggest any thing for this.

    Thanks for code

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465

    Re: Macro or code fetch the data from database and update the database if correction made

    I'm using 2013 and have no problem in speed, so I can not help.

  10. #10
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Re: Macro or code fetch the data from database and update the database if correction made

    ok jindon
    thanks for quick reply

  11. #11
    Registered User
    Join Date
    02-17-2011
    Location
    india
    MS-Off Ver
    Excel 2016 (home & student version)
    Posts
    79

    Re: Macro or code fetch the data from database and update the database if correction made

    Hi,

    I need to create a button for macro.
    in two sheets there is code. i need a code to be in module so that i can create a button for that and whenever i click on buttton ity should should run the macro.

    thanks in advance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel VB help needed to fetch data from database sheet
    By vinayng in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2018, 08:26 AM
  2. Need macros to extract data from database/compare/update database - Excel 2007
    By saroby in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-15-2014, 01:45 PM
  3. Fetch data from database matching two conditions
    By Krishnab4u in forum Excel General
    Replies: 1
    Last Post: 04-03-2014, 07:18 AM
  4. How to insert and update Excel data to SQL database using VBA code
    By ReenaB in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2013, 12:35 PM
  5. Match data between CSV and database and update column in database table
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2012, 05:59 PM
  6. Fetch weekly data from Access database
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2010, 09:52 AM
  7. Replies: 5
    Last Post: 06-11-2006, 04:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1