Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Assign a cell value (from another file) to a varieble

I have try too many things but it does not work.... need to pick up a value
from a cell and place it into a variable... I tried

myVal.Value = [FM Deviation Request R1.0.xls].Form.R2C17
myVal = AOS Deviation Request R1.0.xls.Sheets("AOS Form").Range("Q2").Value"
and many more but can not work.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Assign a cell value (from another file) to a varieble

Dim myVal as Variant
Dim wb as Workbook

'For referring Open workbook
Set wb = Workbooks("workbookname.xls")

'To open a excel file and reference it
'Set wbBook = Workbooks.Open("<fullpath\<filename.ext")

myVal = wb.Sheets("Sheet1").Range("Q2").Value
Msgbox myVal

If this post helps click Yes
---------------
Jacob Skaria


"Alberto Ast" wrote:

I have try too many things but it does not work.... need to pick up a value
from a cell and place it into a variable... I tried

myVal.Value = [FM Deviation Request R1.0.xls].Form.R2C17
myVal = AOS Deviation Request R1.0.xls.Sheets("AOS Form").Range("Q2").Value"
and many more but can not work.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Assign a cell value (from another file) to a varieble

myVal = workbooks("AOS Deviation Request R1.0.xls").WorkSheets("AOS
Form").Range("Q2").Value

Tim



"Alberto Ast" wrote in message
...
I have try too many things but it does not work.... need to pick up a value
from a cell and place it into a variable... I tried

myVal.Value = [FM Deviation Request R1.0.xls].Form.R2C17
myVal = AOS Deviation Request R1.0.xls.Sheets("AOS
Form").Range("Q2").Value"
and many more but can not work.



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
assign file numbers to names NeSchw6G Excel Discussion (Misc queries) 2 December 14th 07 04:23 PM
Assign cell value to equal file path for loading Rookie_User Excel Programming 2 February 7th 07 09:27 PM
How can you assign a bmp. file to a formula or macro? Kelly Excel Worksheet Functions 3 January 11th 07 07:53 PM
VBA assign macro to button from a different file (simple you'd thi NX3 Excel Programming 5 November 22nd 05 04:02 PM
Assign Cell Content As File Name [email protected] Excel Programming 2 October 18th 05 06:42 PM


All times are GMT +1. The time now is 11:18 PM.

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"