#1   Report Post  
Posted to microsoft.public.excel.misc
daroc
 
Posts: n/a
Default help - urgent


hey,

I have to 2 files.

I want to retrieve information from file B and insert it into file A.

File A has empty rows after each row (i.e. A1 filled, A2 EMPTY, A3
filled)

Now I want the information that is in file B to be placed into A2, A4
etc respectively. Please help on this. Thanks


--
daroc
------------------------------------------------------------------------
daroc's Profile: http://www.excelforum.com/member.php...o&userid=30753
View this thread: http://www.excelforum.com/showthread...hreadid=519837

  #2   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default help - urgent

daroc,

how are the data in file B organized? In consecutive rows? If so, you
can fill column B:B in file A with the following formula:

=IF(MOD(ROW(),2)=0,OFFSET('[fileB]Sheet1'!$A$1, ROW()/2,0),"")

Then you fill column C:C with the following formula:
=IF(A1<"",A1,B1)

And copy down as far as necessary.

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.misc
daroc
 
Posts: n/a
Default help - urgent


hey verezid,


the information in SHEET 2 is not consecutive. let me know please thank
you very much


--
daroc
------------------------------------------------------------------------
daroc's Profile: http://www.excelforum.com/member.php...o&userid=30753
View this thread: http://www.excelforum.com/showthread...hreadid=519837

  #4   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default help - urgent

OK, I am running out of inspiration for a formula-based solution (at
least one that will use only one column). Instead you can use the
following VBA macro, which will transfer the data from file B to your
target sheet. This macro should be installed in File A and it requires
that File B is open when it runs:

Sub TransferData()
outrow = 2
For inrow = 1 To 10000
If (Workbooks("File B.xls").Sheets("Sheet1").Cells(inrow, "A") <
"") Then
Cells(outrow, "B") = Cells(inrow, "A")
outrow = outrow + 2
End If
Next inrow
End Sub

What to modify:
-the number 10000 should be changed to the highest number row expected
to contain data in File B
-change the text constants inside the quotes ("File B.xls", "Sheet1")
to the names of the input workbook and sheet respectively.
-Cells(inrow,"A") supposes the data in the input file are in column
"A". Modify to suit. Same for Cells(outrow,"B") for the output file.

How to install:
Alt+F11 to go to the VBA editor.
Menu Insert|Module
Paste the above code after modifications.

To run:
Go to the sheet where you want the data transferred.
Alt+F8 to show the macros dialog box
Select the macro TransferData and Run.

Once the data are imported in column B:B you can use the remainder of
my first post. In column C:C:

=IF(A1<"",A1,B1)

Does this help?

Kostis Vezerides

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
URGENT !! Auto Filter Nirakar Excel Discussion (Misc queries) 1 February 7th 06 08:56 PM
URGENT !! Auto Filter CLR Excel Discussion (Misc queries) 0 February 6th 06 09:31 PM
Urgent appeal dogy Excel Discussion (Misc queries) 0 December 17th 05 02:01 AM
"Urgent" use script to share the workbook man Excel Discussion (Misc queries) 1 August 17th 05 02:09 PM
Urgent Urgent Urgent!!! Ruslan Excel Discussion (Misc queries) 6 March 30th 05 02:59 PM


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