+ Reply to Thread
Results 1 to 2 of 2

Excel 2013 - Macro to update new sheet

  1. #1
    Registered User
    Join Date
    06-11-2014
    Posts
    7

    Excel 2013 - Macro to update new sheet

    Hi All,

    Really new to excel VBA and I'm looking for some help.

    I've got a spreadsheet that pulls data from a SQL server.

    I'm looking to have a button on the first sheet that extracts the data from SQL and inserts it into sheet 2 of spreadsheet.
    The data connection from SqL is working fine but when I click on the button sheet 2 is blank.

    Any ideas...

  2. #2
    Registered User
    Join Date
    06-11-2014
    Posts
    7

    Re: Excel 2013 - Macro to update new sheet

    I found this

    Sub AllStaff()

    Dim conString As String
    conString = GetTestConnectionString()

    Dim query As String
    query = AllStaffquery()

    Dim target As Range
    Set target = Sheets(2).Cells(30, 1)

    Select Case ImportSQLtoQueryTable(conString, query, target)
    Case Else
    End Select

    End Sub

    but this doesn't work

+ 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. Replies: 3
    Last Post: 07-20-2014, 11:46 AM
  2. Update calendar for 2013 - 2020 with events from the database sheet
    By ganzzu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2013, 08:58 AM
  3. [SOLVED] Excel Command Button Macro to ask for Part # and update another sheet with info
    By dka5034 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-14-2013, 08:36 AM
  4. Using a Macro to update locked excel sheet
    By Zunit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2013, 03:45 AM
  5. macro button to update excel sheet
    By mikeydaman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2008, 03:22 AM

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