+ Reply to Thread
Results 1 to 2 of 2

Return MAX() Value to VBA variable from SQL

  1. #1
    Forum Contributor
    Join Date
    05-17-2012
    Location
    CA, USA
    MS-Off Ver
    Microsoft Excel for Microsoft 365
    Posts
    163

    Return MAX() Value to VBA variable from SQL

    I would like to assign and return a Max value from a SQL query to a variable within VBA. Below is the code I am working with at the moment to obtaining this. Not sure if I assigned all variables or if my programming is incorect.

    Please Login or Register  to view this content.
    Hope the code above helps to see what I'm doing.

    Thank you,
    Tyler
    Last edited by T86157; 02-22-2019 at 01:26 PM.

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Return MAX() Value to VBA variable from SQL

    I didn't test your code as a whole but, can you try this?

    Please Login or Register  to view this content.
    .

+ 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] return Variable Value through concatenation
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2014, 11:08 AM
  2. Return Variable Name if Max Value
    By haleyac2008 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-27-2014, 03:32 PM
  3. [SOLVED] IF Statement to return variable outcomes
    By Brebs69 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2013, 02:13 AM
  4. Return value from 3 variable columns
    By Jafs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-18-2013, 05:11 AM
  5. How to store the return value from cmd to a variable?
    By jonelamora in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-08-2012, 10:21 PM
  6. SQL Query Return One Variable
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2011, 12:34 AM
  7. How do I return a cell address in a variable
    By CaseyC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2007, 06:55 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