Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Copy cell data from workbook based on user input

Hello All, any help would be greatly appreciated. Im trying to copy the cell
data from one workbook to another and Im not sure what Im doing. Could
someone please help? I want the user to type "30" and it to find the data on
30.xls .. etc.

Here is what I have.. obviously it dosn't work :)

Sub Copy()
'

Dim sStuff As String


sStuff = InputBox("What date is this for? I.E 1,2,3 etc.")


'
Range("B20").Select
ActiveCell.FormulaR1C1 = "='\\Server1\Important Files\[" & sStuff &
".xls]Totals'!$H$3"

End Sub

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy cell data from workbook based on user input

Hi Michael A
try this in your sub after inputbox

Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"\\Server1\Important Files\" & sStuff & ".xls"
Worksheets("your sheets name").Activate
Range("B20") = Worksheets("your sheets
name").Range("H3").Value
ActiveWorkbook.Close False
Application.ScreenUpdating = True

regards yngve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Copy cell data from workbook based on user input

Hi Evgny,

Thanks for the response. This is close to what I need. However it is trying
to put the totals of cell H3 into B20 on the same sheet. I need it to take
the info from the cell H3 on the sheet that was opened to the B20 column on
the sheet that ran the macro. Any idea on how I can do this?

"evgny" wrote:

Hi Michael A
try this in your sub after inputbox

Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"\\Server1\Important Files\" & sStuff & ".xls"
Worksheets("your sheets name").Activate
Range("B20") = Worksheets("your sheets
name").Range("H3").Value
ActiveWorkbook.Close False
Application.ScreenUpdating = True

regards yngve


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy cell data from workbook based on user input

Hi
range(h3) is that on the workbook you open or .....
and there are only one value i range(h3), what do you meen with
"Totals"

regards yngve

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Copy cell data from workbook based on user input

Hi,

In totals, I ment Values. I want the value in H3 on the worksheet in the
workbook that is opened by your macro to be put into the B20 cell of the
original sheet in the original workbook. (the sheet the macro was opened
in)by the user.

"evgny" wrote:

Hi
range(h3) is that on the workbook you open or .....
and there are only one value i range(h3), what do you meen with
"Totals"

regards yngve




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Copy cell data from workbook based on user input

hi Michael

Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"\\Server1\Important Files\" & sStuff & ".xls"
Worksheets("your sheets name on the sStuff").Activate

' now you are in the workbook(sStuff.xls).worksheets(????)

workbooks"(your original workbook name"). Worksheets("your
original sheetsname"). Range("B20") = workbooks(sStuff &".xls").
Worksheets("your sheets
name in sstuff").Range("H3").Value
ActiveWorkbook.Close False
Application.ScreenUpdating = True

Regards
yngve

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
Extracting Data from another worksheet based on user input Alvyn Excel Worksheet Functions 14 August 6th 08 05:41 PM
Incrementing Data based on user input learningaccess Excel Discussion (Misc queries) 3 January 26th 07 03:28 PM
Changing Cell Contents Based Upon User Input BigCheese Excel Programming 1 June 23rd 04 07:09 PM
Rollup of Data in Multiple Sheets (based on user input) Gauthier Excel Programming 1 December 10th 03 12:55 PM
select data based on user input Dave Ramage[_2_] Excel Programming 0 July 28th 03 12:50 PM


All times are GMT +1. The time now is 02:55 PM.

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

About Us

"It's about Microsoft Excel"