Hi,
Using some of Ron's Code. I want to change this bit of code to look at first sheet regardless of Sheet name
![]()
Please Login or Register to view this content.
tried this but didn't work
Sheets("Sheet1")
Any help appreciated
VBA Noob
Hi,
Using some of Ron's Code. I want to change this bit of code to look at first sheet regardless of Sheet name
![]()
Please Login or Register to view this content.
tried this but didn't work
Sheets("Sheet1")
Any help appreciated
VBA Noob
Use: Sheets(1)
HTH
Col
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
Get a run time error 438 when I change it
VBA Noob
Hi,
I am not sure if this helps, but if GetData requires a string variable with sheet tab name, try:
If it requires sheet code name try using Sheets(1).CodeName instead.![]()
Please Login or Register to view this content.
MS Excel Games Library and much more:
http://www.dzikosoft.com/gmexcel
Sorry, my bad! Bartek is of course right.
C
Thanks Guys.
Will give it a go
VBA Noob
Hi again,
Still trying to modify this code.
If I change it to Sheets(1).Name I get sheet name error messages.
I then tried to pull off any sheet names called "New". Still get the error message if a sheet didn't have that name.
tried on error resume next and application.displayalerts = false. Anyone got any ideas how to amend the code to either pull off worksheets called New or ideally the first sheet in the workbook regardless of name
Many thanks
VBA Noob
Can you post a link to where you got the code on Rons site?
Sure,
Here is the link. Thanks for taking a look at it for me
http://www.rondebruin.nl/ado.htm#subfolders
VBA Noob
Hi,Originally Posted by VBA Noob
This just follows what everyone else has said but this works. Any clues in it that you could use?
Public Sub FirstsheetInBook()
'Uses 1st sheet positioned on the left in w/book
'Uses by location, ignores given & code names.
Sheets(1).Range("a1").Value = 300
End Sub
Thx
Dave
"The game is afoot Watson"
As the code is reading from the SourceFile workbook without opening it you'll need to know the name of the sheet beforehand - there's no way to check what it's called without opening the file to see (as far as I know, although I'm always happy to be proved wrong!)
C
Thanks.
I'm hoping your wrong thou.
VBA noob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks