PC Review


Reply
Thread Tools Rate Thread

Assign a cell value (from another file) to a varieble

 
 
Alberto Ast
Guest
Posts: n/a
 
      26th Oct 2009
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 With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      26th Oct 2009
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.

 
Reply With Quote
 
Tim Williams
Guest
Posts: n/a
 
      26th Oct 2009
myVal = workbooks("AOS Deviation Request R1.0.xls").WorkSheets("AOS
Form").Range("Q2").Value

Tim



"Alberto Ast" <(E-Mail Removed)> wrote in message
news:17ABA8A0-12A0-4BA0-A227-(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign Color to a Cell based on another Cell on a diff Sheet VROSARIO7 Microsoft Excel Worksheet Functions 1 6th Jul 2009 08:48 PM
Assign cell value to equal file path for loading =?Utf-8?B?Um9va2llX1VzZXI=?= Microsoft Excel Programming 1 6th Feb 2007 05:34 PM
How do i assign cell A1 to show the current cursor cell in Excel? =?Utf-8?B?T0I=?= Microsoft Excel Misc 2 11th Oct 2006 04:02 PM
Assign Cell Content As File Name paul.sternhagen@gmail.com Microsoft Excel Programming 2 18th Oct 2005 06:42 PM
assign cell content as file name paul.sternhagen@gmail.com Microsoft Excel Discussion 1 18th Oct 2005 05:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:45 PM.