Import Daily Data into Excel Columns

T

Tai

Hi Excel Gurus--
I am trying to import daily GL balances into Excel for analysis. I'd
like to keep all the daily balances in separate column (1-31). Right
now I just right-click and refresh the data, but it override yesterday
balance. To prevent this I have to copy yesterday balance to another
column. Is there a way to have Excel refresh data by insert a new
column and push the previous data one column to the right? This way I
can keep all my 30 days balances.
Thank you for your help.

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins &
Software!http://www.ozgrid.com/Services/excel-software-categories.htm **
 
T

Tai

There is no code. Maybe this will help. The data I imported by go to
DATA - IMPORT EXTERNAL DATA - NEW DATABASE QUERY. After connect to the
database, I select the account number and the balance fields to import.
Every day, I right-click the spreadsheet and select REFRESH.
Unfortunately, this will override the previous day balances and I'd to
keep all 30days balances to do the analysis. Hope this will help.
Thanks.
Tai

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins &
Software!http://www.ozgrid.com/Services/excel-software-categories.htm **
 
D

Don Guillett

Then I would suggest a macro that copies the data to a column in ANOTHER
worksheet before refresh. UNTESTED

Sub copycol() ' Before Refresh
With Sheets("destinationsheet")
x = .Columns.Count + 1
Sheets("datasheet").Columns(1).Copy _
..Columns (x)
End With
Sheets("datasheet").QueryTables(1).Refresh
End Sub
 
D

Don Guillett

try this instead
..Columns (lc=cells(1,columns.count).end(xltoleft).columns+1)
Sub copycol() ' Before Refresh
With Sheets("destinationsheet")
Sheets("datasheet").Columns(1).Copy _

..Columns (cells(1,columns.count).end(xltoleft).columns+1)
End With
Sheets("datasheet").QueryTables(1).Refresh
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top