Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loading Values From Another Sheet Automatically


I've created a sheet to estimate a job project and now I am working on a
new sheet to keep track of our estimated totals compared with actual
expenses.

What I need is to make a macro that allows you to browse the PC and let
the user select the excel sheet where all the Estimate Values are
stored.

Afterwhich, the main sheet would pull values from that sheet.

{Use Cell A1 as an example and I can take it from there}

Thanks


--
SanctifiedRock
------------------------------------------------------------------------
SanctifiedRock's Profile: http://www.excelforum.com/member.php...o&userid=34485
View this thread: http://www.excelforum.com/showthread...hreadid=560804

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Loading Values From Another Sheet Automatically

Hi SanctifiedRock

You can try
http://www.rondebruin.nl/ado.htm


Or open the file like this to copy A1 of the first sheet to the workbook with this macro

Sub test()
Dim FName As Variant
Dim wb As Workbook
Dim MyPath As String
Dim SaveDriveDir As String

SaveDriveDir = CurDir

MyPath = ThisWorkbook.Path
ChDrive MyPath
ChDir MyPath

FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls")
If FName < False Then
Set wb = Workbooks.Open(FName)
ThisWorkbook.Sheets("Sheet1").Range("A1").Value = wb.Sheets("Sheet1").Range("A1").Value
wb.Close False
End If

ChDrive SaveDriveDir
ChDir SaveDriveDir

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"SanctifiedRock" <SanctifiedRock.2auh36_1152728108.9853@excelforu m-nospam.com wrote in message
news:SanctifiedRock.2auh36_1152728108.9853@excelfo rum-nospam.com...

I've created a sheet to estimate a job project and now I am working on a
new sheet to keep track of our estimated totals compared with actual
expenses.

What I need is to make a macro that allows you to browse the PC and let
the user select the excel sheet where all the Estimate Values are
stored.

Afterwhich, the main sheet would pull values from that sheet.

{Use Cell A1 as an example and I can take it from there}

Thanks


--
SanctifiedRock
------------------------------------------------------------------------
SanctifiedRock's Profile: http://www.excelforum.com/member.php...o&userid=34485
View this thread: http://www.excelforum.com/showthread...hreadid=560804



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Loading Values From Another Sheet Automatically

this pseudo code might help:

Dim fname as String
Dim bk as Workbook
Dim rng as Range
fname = Application.GetOpenFileName( _
FileFilter:="Excel Files (*.xls),*.xls")
if fname = "False" then
' user hit cancel, exit sub
exit sub
end if
set bk = workbooks.Open(fname)
set rng = bk.Worksheets(1).Range("A1")
rng.CurrentRegion.copy _
thisworkbook.worksheets(1).Cells(rows.count,1).End (xlup)(2)

.. . .


bk.close SaveChanges:=False

--
Regards,
Tom Ogilvy

"SanctifiedRock" wrote:


I've created a sheet to estimate a job project and now I am working on a
new sheet to keep track of our estimated totals compared with actual
expenses.

What I need is to make a macro that allows you to browse the PC and let
the user select the excel sheet where all the Estimate Values are
stored.

Afterwhich, the main sheet would pull values from that sheet.

{Use Cell A1 as an example and I can take it from there}

Thanks


--
SanctifiedRock
------------------------------------------------------------------------
SanctifiedRock's Profile: http://www.excelforum.com/member.php...o&userid=34485
View this thread: http://www.excelforum.com/showthread...hreadid=560804


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loading Values From Another Sheet Automatically


this pseudo code might help:

Dim fname as String
Dim bk as Workbook
Dim rng as Range
fname = Application.GetOpenFileName( _
FileFilter:="Excel Files (*.xls),*.xls")
if fname = "False" then
' user hit cancel, exit sub
exit sub
end if
set bk = workbooks.Open(fname)
set rng = bk.Worksheets(1).Range("A1")
rng.CurrentRegion.copy _
thisworkbook.worksheets(1).Cells(rows.count,1).End (xlup)(2)

.. . .


bk.close SaveChanges:=False

--
Regards,
Tom Ogilvy


Can I get this written in a way where it draws out the data withou
opening the other workbook, it just automatically pulls certain cell
from the workbook while it is closed and displays them in the ne
workbook

--
SanctifiedRoc
-----------------------------------------------------------------------
SanctifiedRock's Profile: http://www.excelforum.com/member.php...fo&userid=3448
View this thread: http://www.excelforum.com/showthread.php?threadid=56080

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
how can i stop the reviewing toolbar from automatically loading? bj62 Excel Discussion (Misc queries) 3 September 2nd 08 05:13 PM
update a sheet automatically with changing values from another she QP1 Excel Worksheet Functions 1 July 17th 08 07:54 PM
How do I automatically copy cell values from one sheet to another? stevebert1 Excel Programming 2 September 28th 05 03:51 PM
inserting values automatically from one sheet to another jarow Excel Programming 1 October 20th 04 02:02 PM
Loading values into a form on open. J. Vandenberg Excel Programming 3 September 28th 03 03:38 AM


All times are GMT +1. The time now is 11:42 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"