how can I create a multiple VBA input list to fill in excel cells

G

Gian Capannesi

I am trying to use VBA to create an input list for multiple cells in a
workbook with multiple sheets for example

date 25th of the month

Chicago - 2000
Denver - 1000
NY - 15000

When I press enter I would like it to fill in the respective cells in the
separate sheets - for the 25th of the month
 
J

Jason

There are several ways on doing it. I usually use the Excel Object Model.
First you have to set a reference to it in Tools>References
Then the VBA code looks something like this:

Dim objWB As Excel.Workbook
Set objWB = GetObject("C:\MyWorkbook.xls")
objWB.Sheets("Sheet1").Cells(5,5) = 2000
objWB.Close true
Set objWB = Nothing

Is this anything like what you wanted?
 

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