Hi Guys, how do get data from a cell in a different woorkbook using VBA code
Thanks
Hi Guys, how do get data from a cell in a different woorkbook using VBA code
Thanks
umm could we have a little bit more info please. not a lot to work with.
Ok Sorry,
In a Cell you can enter a formula i.e C:\Test.xls!GOTOCELLA, so this will get the named cell GOTOCELLA from excel workbook test.xls
But instead I need to get this formula into VBA
Hope this makes more sense
Thanks
I understand now
what you need to do is some like this
Sub example
dim Data as string
workbooks.open filename:="C:\test.xls"
'adding the value to our varible called data
Data = sheets("Sheet1").Range("a1").value
application.activewindow.close
activecell.value = data
end sub
this option breaks the link between the to workbooks
or
if you know a formula that you would normally type in a cell you can type the following
range("a1").formual="=sheet1!a1"
this line will apply that formula to cell a1.
hope this helps
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks