+ Reply to Thread
Results 1 to 11 of 11

hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    U.S.A
    MS-Off Ver
    Excel 2010
    Posts
    6

    hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    Book2.xlsm
    I have never written a vBA codeor any codes
    Write VBA functions to retrieve relevant data for an arbitrary species and test
    them with the following cell calling sequences for carbon dioxide.
    Tc(“CO2”) Critical temperature (C)
    Pc(“CO2”) Critical pressure (bar)
    Vc(“CO2”) Critical volume (cm/mol)
    Tmin(“CO2”) Minimum temperature for the Shomate equation (C)
    Tmax(“CO2”) Maximum temperature for the Shomate equation C)
    (2) Write VBA function to calculate the standard heat capacity, enthalpy, and
    entropy as functions of temperature for an arbitrary chemical species. Test these
    functions with the following cell calling
    sequences for carbon dioxide with the
    temperature in degrees Celsius.
    Cp0(“CO2”,500)
    H0(“CO2”,500)
    S0(“CO2”,500)
    (3) Write a VBA function to calculate the molar volume (cm
    3/mol) of an arbitrary species as a function of P (bar) and T̊C). This will require using bilinearinterpolation of the Lee/Kessler tables. In your Excel worksheet, call this functionas follows for carbon dioxide:
    MolarVolume(“CO2”,10,100)
    MolarVolume(“CO2”,40,295)
    MolarVolume(“CO2”,70,30)

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    Hi,

    What makes you think you need a VBA macro?

    If you can manually add some results to your workbook and tell us where the results are and in narrative form explain how you have calculated the results we'll be in a better position to assist.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,023

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    I guess that, if you're using Excel/VBA as part of your course, they will have provided some tuition and will be expecting YOU to use VBA to produce the functions ... not the members of an on-line forum.

    Tell us what code you have produced and what it does and what it does not do ... and we'll try to help you make it work.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,023

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    @RB: I guess that would be because the textbook says he needs a VBA macro

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    @TMS

    Good point! Must be getting tired and missed that. Isn't it time you were in bed anyway?

  6. #6
    Registered User
    Join Date
    02-06-2014
    Location
    U.S.A
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    programing class was not listed as a requirement for this course by mistake and we dont use textbooks for this course. he just sowed us the basic macros.

  7. #7
    Registered User
    Join Date
    02-06-2014
    Location
    U.S.A
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    i did not even know what macros or vba codes were before this class. i tried search engine but did not get any results

  8. #8
    Registered User
    Join Date
    02-06-2014
    Location
    U.S.A
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    i will try
    Last edited by lildesidiva; 02-06-2014 at 10:05 PM.

  9. #9
    Registered User
    Join Date
    02-06-2014
    Location
    U.S.A
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    i really need to do the 1st question in order to do the second question . so, can you please help me.

  10. #10
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,528

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    I don't know exactly what you are expected to do for this. As a chemist myself, I created a workbook/add-in very similar to this that uses VBA UDF's to retrieve property data for chemicals. Obviously, I can't just give you the code for this, you need to do this yourself for practice. At the heart of my code are Excel's built in lookup functions. My suggestion for doing this:

    1) Do it first in the spreadsheet without VBA using Excel's lookup functions: http://office.microsoft.com/en-us/ex...670.aspx?CTT=1 VLOOKUP() is probably the most commonly used lookup function.

    2) Once you can see how the lookup functions work, then you can learn how to access them from VBA: http://msdn.microsoft.com/en-us/libr...ffice.14).aspx

    This assumes that you're allowed to use Excel functions in VBA for this assignment. If you must code your own lookup function, then come back and we can talk about lookup/search algorithms.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  11. #11
    Registered User
    Join Date
    02-06-2014
    Location
    U.S.A
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: hi, i need help writing a VBA Function to retrieve data from one worksheet to another?

    thank you so much

+ 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. [SOLVED] Writing into Excel worksheet from custom VBA function (not sub)
    By Drsja in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-25-2013, 02:53 PM
  2. Writing a Function that controls 5 different macros that retrieve stock price.
    By sf3500 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2013, 06:13 PM
  3. Connection but no records writing VBA query to retrieve data from SQL Server 2012
    By sportsguy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-01-2012, 03:20 PM
  4. retrieve data from another worksheet
    By jkarson in forum Excel General
    Replies: 5
    Last Post: 04-04-2012, 06:28 PM
  5. Replies: 1
    Last Post: 10-04-2006, 12:41 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