Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 331
Default Set a cell from another worksheet

This should be VERY simple. I'm trying to code VBA for the first time, and I
get a syntax error on the below statement. From all the tutorials I read,
this should work.
any clue?

Range(a99) ='[Book1.xls]Sheet1'!$B$1
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,533
Default Set a cell from another worksheet

Hi Greg

You need a little more code to make it work, and double qutation signs.

Have a look at this:

With Workbooks("Book1.xls")
MyValue = .Sheets(1).Range("B1").Value
End With
Range("A99") = MyValue

Regards,

Per

"Greg" skrev i meddelelsen
...
This should be VERY simple. I'm trying to code VBA for the first time,
and I
get a syntax error on the below statement. From all the tutorials I read,
this should work.
any clue?

Range(a99) ='[Book1.xls]Sheet1'!$B$1


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 331
Default Set a cell from another worksheet

Wow, that's a far cry from seeing some tutorials that say to do it like this:
='C:\My Documents\Worksheets\[Book1.xls]Shhet1'!$B1

but it worked!! Thank you!!


"Per Jessen" wrote:

Hi Greg

You need a little more code to make it work, and double qutation signs.

Have a look at this:

With Workbooks("Book1.xls")
MyValue = .Sheets(1).Range("B1").Value
End With
Range("A99") = MyValue

Regards,

Per

"Greg" skrev i meddelelsen
...
This should be VERY simple. I'm trying to code VBA for the first time,
and I
get a syntax error on the below statement. From all the tutorials I read,
this should work.
any clue?

Range(a99) ='[Book1.xls]Sheet1'!$B$1



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to name worksheet tabs using a cell within the worksheet? Jennifer Excel Discussion (Misc queries) 4 November 6th 12 05:03 PM
Can I click on a cell on one worksheet and make it take me to another worksheet steve12345 New Users to Excel 7 November 5th 12 06:45 PM
How do I copy a date in a worksheet cell to another worksheet? JennLee Excel Worksheet Functions 3 February 17th 06 05:38 PM
How can I link cell colours from worksheet to worksheet/workbook? Evelyn Excel Worksheet Functions 1 July 5th 05 09:16 PM
Worksheet reference (i.e placing worksheet name in a cell) Roger Roger Excel Worksheet Functions 1 January 20th 05 03:40 PM


All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"