Question about creating macro (to export to quickbooks pro)

  • Thread starter Thread starter billybob
  • Start date Start date
B

billybob

I have only created basic macros before. I am wondering how hard it is to
make one that will open each spreadsheet in a folder and find the total and
paste it in another sheet. (I then want to import all these into my sister's
"quickbooks pro") This is my thought not having even seen the program yet
but I know it imports from excel. If anyone has a better suggestion, please
let me know :O)
 
it might take some work on your part to learn, but its not hard.

the Sub X below is mostly from another post - it loops thru all xls files in
a particular directory. from inside the loop you can open, manipulate, copy
paste, etc to a new workbook.

remember to turn off screen updating

rgds- voodooJoe




Sub x()

set wbTarget = thisworkbook

'where are the old files?
strFolder = "c:\"

If Right(strFolder, 1) <> "\" Then strFolder = strFolder & "\"
f = Dir(strFolder & "*.xls)

Do While f <> ""
Set wbSource = Workbooks.Open(strFolder & f)
Debug.Print wbSource.Worksheets(1).Name 'do stuff - wb will be
the workbook object
'wbTarget blah blah blah - wbTarget will be this workbook
containing the code that you want to consolidate to

wbSource.Close
f = Dir()
Loop

Set wb = Nothing
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

Back
Top