Free Microsoft Excel 2013 Quick Reference

To copy data from one sheet another using vlookup Results

I have a doubt on VLookup function.For eg sheet1 have names of 20 persons and sheet 2 also contains names of 25 names of which sheet 1 and sheet 2 have 5 names in common. I want to copy the names of sheet 1 to sheet 2 which is not in sheet2. How can I copy the names using VLookup?

Hello, I am working in Excel '97, I am trying to set up a macro to copy data from rows on sheet 1 (Master Log) to rows on sheet 2 (By Quotes) but only if certain criteria is true based on the job type (column a).


Master Log:
a b c d e
1 type date model prtno qty
2 qte 2/1 m3 245 25
3 prt 2/2 m2 367 35
4 qte 2/2 m4 468 45
5 qte 2/3 m7 572 55

By Quotes:
I want it to show the same information as what is on the rows that have the 'type' = qte only. In other words to disclude row 3 that has prt.

I have tried setting up functions using IF, VLOOKUP, & LOOKUP. I haven't even come close to getting this to work. I want to set this up in a macro and then use the same thing to create sheets for the other job types so we can have a master log and then separate logs based on the job type. Any help that can be provided would be tremendously appreciated. I thought this was going to be easy and I guess for me it isn't. Thank You!!!

Hi all,

I need your help writing some VBA codes.

I have two workbooks: Workbook1 has two sheets – Cash Register and Suppliers; and Workbook2 has one sheet – Clients. The users of Workbook2 do not have access to Workbook1, and information entered in Workbook2 is required (and has to be manually re-entered) in Workbook1.

I tried IFs and VLOOKUPs to pull the data, but due to the large number of cells, the workbook is awfully slow – taking a very long time to save (even with Automatic Calculation/Recalculate before save turned off).

I am using Excel 2007.

When a user enters an ID number, which begins with either “S” (e.g., SB-00010) or “P” (e.g., PADA-012-034-0567), in column E of Cash Register:


If that ID number begins with “S”, I want the code to look up that ID number in column A of Suppliers and copy the corresponding cell from each of the following columns:


and then paste them in the following columns of the Cash Register in the same row as the ID number looked up:

F (paste B)
G (paste C)
H (paste D)
I (paste E)
J (paste F)
K (paste G)



If the ID number begins with “P”, I want the code to look up that ID number (e.g., PADA-012-034-0001) in column Q of Clients, and copy the corresponding cell from each of the following columns:


and then paste them in the following columns of the Cash Register in the same row as the ID number looked up:

F - paste R;
H - paste AA (if it is not blank); add a hyphen (if AA is not blank); paste Z (e.g., 1625-123 Yonge Street)
I - paste AB
J - paste AC
K - paste AD

Thanks in advance for your help. I really appreciate it.



Could i please ask for assistant. I am newbie to macro and learning quickly.

I have 3 sheets.

sheet = Main Menu
sheet = Consumables In AM Rack
sheet = Consumables Used From AM Rack.

User enters a location in Main Menu sheet (vlookup lookup code and qty).

Then press the button "Transfer From STORAGE to USED". (black button)

This is where i need help. When the button is pressed i want to copy date& Authorised By(yellow box) to consumables used from AM Rack sheet. Delete the code & qty from from the Consumables In AM Rack and copy it to Consumables Used From AM Rack.

I have gone through this forum couldn't find anything that resiamble my problem

Any assistant would be appricated.

Hi to all,
I am facing the run time error 9 for the following code i am trying to copy data from one worksheet to another some what like vlookup.

 e, c 
Dim d 
Dim t(1 To 10)  As Integer 
Dim r(1 To 10) As Integer 
Dim z As Integer 
Dim y, f, i As Integer 
z = 1 
y = 1 
Set d = Workbooks("data2").Sheets("sheet1").Range("a2:a6") 
For Each c In d 
    t(z) = c.Value 
     'Debug.Print t(2)
    z = z + 1 
Next c 
Set e = Workbooks("data1").Sheets("sheet1").Range("a2:a6") 
For Each c In e 
    r(y) = c.Value 
    Debug.Print r(3) 
    y = y + 1 
Next c 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
line highlighted with red havng the eroor..... wll this is not the complete code...

I have two worksheets - "Table" and "Report" - inside of a workbook. The Report sheet is a series of vlookups to the table. I have used data validation so that a user can select a property from a drop-down menu and display all the information for that property from the "Table" in a neat "Report."

I want to write a macro that will print all the properties in the "Report" format. So, essentially, I need to copy the property info from Column A on the "Table" worksheet into the "Report" one at a time and print in between. This is what I have so far:

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

I want to continue with cell A4 next and down to the last row. The catch as that I want the macro to know when to stop - so if I had more properties, the macro will still work.

Does anyone know how to do this?

I am trying to find a formula or code that I can use to lookup data from one sheet and copy it to another sheet. I tried to use the Vlookup funtion but it will only display the first occurance of the data found. (Ref # 1) What can you use when you have multipul occurances.

C1 D1 E1 F1 G1
Ref Date Item Unit Fuel Type
1 June 1 Truck Brandon Desiel
2 June 1 Trailer Drop Deck None
1 June 1 Truck Shelby Desiel
3 June 2 Bus 101 Gas
1 June 3 Car 21 Desiel

C1 = input cell (Value (1) is entered) and I would like all other data tied to (1) to fill down
=VLOOKUP($C$1,'Current Activity'!$E$6:$G$88,4,))

Ok, so I have one database sheet which is automatically updated.

Is it possible to create a macro which would copy data from one cell on one sheet and paste it onto a new line of another sheet.


Sheet 1

A1 = Thursday (this would update to whichever day it is)

Sheet 2


Etc, etc

If it's possible it would be a great help. Cheers.

EDIT: If its possible to achieve the same goal without the use of macros, vlookup or something, then any help with that would be appreicated. Thanks.


I need help with macro please can i ask for assistant. Have been trying now for few days and not getting any where.

I have attached file.

User enters Slot No in N13 (AM351001).
Cell N17 (code) & O17 (qty) is Vlookup AM351001 from sheet called Consumables In AM Rack.

What i want to do is user enter a slot in N13, Vlookup looks up the code & qty, then user enters qty which needs to be subtract in cell P17, O19=date and O20=name..

Once the data is filled in (green boxes), I want P17 qty to be subtract from the sheet called Consumables In AM Rack. And transfer the details which user has enter in sheet called Consumables Used From AM Rack.

User enters in green box.
cell N13 = AM351001
cell P17 = 300
cell O19 = 18/08/2009
cell O20 = Hit.

When button is pressed.

1st cell P17 = 300 is subtracted from Consumables In AM Rack against AM351001.

2nd copy all the details which user enterd in sheet Consumables Used From AM Rack.
cell N17 = (lookupcode) in column B
cell P17 = 300 in column C
cell O19 = 18/08/2009 in column A
cell O20 = Hit. in column D

If you look at the file you will easly see it.

Please please can someone assist me.

Many thanks

Hey all,

Currently I'm trying to pull data from a list which is copied from a text file into an excel sheet. I have to run a text to columns format change in order to get it into four seperate columns. The data in question is placed in columns A and D. A is the name for the data while D is the actual information.

The data is 3 weeks worth of information by day stacked on top of one another all the way down the page. What I want to do is sift out specific data points from this information. Typically I'd use a Vlookup but the problem lies in the fact that the number of data categories vary from day to day so I can't just paste a formula down the page unfortunately.

For example, say for 2/11/08 I've got 3 data categories, 2 of which I want to pull out. But for 2/15 I've got 6 data categories 4 of which I need to pull out.

The names of the categories are always the same, I need a certain set of categories from every day IF they appear on that day. So if a day has Breaks for example I need those but I won't need Multimedia if that's there.

I toyed with the idea of sorting it but saw no way to diffrentiate what day something came from. There may be a solution for that though, is there a way to check and see if something is a date. For example could I set up something that says if right 6 of this cell is a date then display the date otherwise display the cell above? That would let me assign dates to the rows thus allowing me to sort them... I think.

Any help would be appreciated.

I have a workbook created with two worksheets -

1. 1st Sheet (labeled "Coupon")I use for inputing data to process a customer's request...
2. 2nd Sheet (labeled "Skip Slips Processed")

I have to concerns:

1. The 1st sheet is a fill in sheet and is printed and processed. It must not be saved with the inputed data - it needs to clear and be ready for the next input after printing.

2. On sheet 1 (Coupon) I have several cells to fill but from those cells I need the same data to be inserted into a running log that we use as a record of proof that we have completed the process. I need to take the date, cstmr name, acct #, and loan type from sheet one and place it into sheet 2.

I wasn't sure if there was a series of functions or a VBA would need to be created.
I don't know how to tell the cell from sheet 1 to Goto the next empty cell on sheet 2 (vertically down - maybe VLOOKUP? and input the data for the date...) then another cell to Goto the column next to that one and fill in...

I hope I'm making this clear.

I thought it would be a VLOOKUP working with one colum at a time - for example
if cell A1 from Sheet 1 were the date - and I wanted that to be the first input to sheet 2 first column first empty cell -

if cell G1 from sheet 1 were the Cstmr name and I wanted it to go from there to sheet 2 2nd column first empty...and so forth...

Hello everyone,
I need some help. I want to copy matching data from one worksheet to another in Excel, using a macro.
sheet 1
row# oprid loc posn date
1 AA dallas manager 10/10/07
2 BB houston asst mgr 09/10/07
3 CC austin clerk 10/12/07

Sheet 2
row# oprid loc posn date
1 AA dallas clerk 01/01/07
2 AA plano asst mgr 01/05/07
3 AA merril mgrI 01/07/07

Now I need a macro for the following fucntion:
For the oprid=AA in Sheet1, look up values in sheet 2 for all matching AAs and copy all those 3 rows from Sheet 2 and paste them in Sheet 1, starting from Row#4 thru 7. I tried VLOOKUP, but it didn't help.
Any help is greatly appreciated.


'in below "do while macro" I would like to find/use the value in cell (x,3)
in activesheet and goto next sheet x 2 'and find the same value which is
stored in column 1 and from that row copy value in column 7 'which I then use
i prev sheet x 2 and insert in cells (x, 6)

'Do I use some kind of vlookup?

Sub Hämta_instrumentnamn()



x = 5

Do While Cells(x, 3).Value <> ""

Cells(x, 3).Value.Copy

x = x + 1


End Sub

Hello everyone,

I am having trouble with the vlookup command. The problem is, the value the function is trying to lookup cannot be found in the data set I give it to look in (so excel says). I have it setup to find X in 2 columns on another worksheet where the first column contains X and the function is setup to return the 2n'd column value, say Y. Well, it is telling me X isn't there, but it is...

I did some digging by using the find function and found that the only way "find" will work is if I tell it to "look in" the "values", not the defualt "formulas". I know the data I am searching for does exists because I can copy the data from one sheet and "find" it in the other by telling it to look for a value instead of forumula. How can I tell the vlookup function to look in the "values" and not the "function"?

In addition, there are no functions in the data set I am searching through, it is imported data from a delimited text file.

How can I make this work?


I have a worksheet with a drop down box containing the numbers 1 to 36. Each one of these represents a specific month for a billing invoice. When I select a number, it populates a mock bill on the page with data from a table in another worksheet.

On the right of my mock bill sheet, I have cells that can "override" the default data from the other worksheet. Now I need to store these overrides in the table on the other sheet.

On the bill page, these overrides are in cells in two columns. They need to be copied to the appropriate row (which changes depending on the dropdown) on the data worksheet.

I use a standard VLOOKUP formula to pull data from the table on the other worksheet, but I will need to use VBA to copy data from specific cells to other cells. Which cells I will copy to must be based on the dropdown box.

The number 1 in the dropdown will need to copy a cell value from a specific cell on the bill page to a specific cell on the data page in row 9. The number two will need to copy the same cell value to a cell in row 10, etc.

I want to make a button that will do this for all the override cells. I will also need to reverse that, so when an invoice # is selected from the drop down box, it copies the data from the specific cells in the corresponding row on the table worksheet to the override cells on the bill worksheet.

I hope this makes sense and can be done.


I have two drop down boxes, one for the month and one for the day. My user will then choose the month and date. From this I have the two figures CONCATINATEd. For example, January 20 would turn into 120.

The user then enters a number next to the "SM:" & "Farmer's:" box. I want those numbers to be copied to the 2nd sheet in a specific location.

My thinking so far has been I need the month and day turned into something that could be used along the lines of a VLOOKUP. Excel could then VLOOKUP down to 120 (which would be January 20 on page 2) and paste in the values entered by the user next to the SM and Farmer's box when the user hits a button that I assume will need to be made along with a macro.

(NOTE: I was trying to do it a different way and I only changed January of 2009 for the dummy sheet as I may be way off.)

Yes, the user could go to the 2nd sheet and enter the data directly, however the overall data there is not for everyone's eyes.

I could, and most likely am, going about this in a cumbersom way...I'm not in love with any aspect of what I have done and if there is a better way, I'm open to it.


I want to extract data from one spreadsheet into another using the IF and VLOOKUP functions. One spreadsheet contains the names with empty cells(Master Sheet) and the other contains the names with the data in a variety of columns, but on the same row for each employee(Balances) I need to have it on the same rown in the Master Sheet for each employee. Can that be done? I've attached a sample copy.


I am an Excel 2003 user.

I need to populate a column in a sheet based on a date stamp record falling within start and end time stamps.

On one sheet, I have a start time record in column B. On another sheet, I have schedule data with both start and end time records as well as a team designation.

I need to look at a record on sheet one, examine the time stamp, do a lookup in sheet two and find the first record in sheet two where the time stamp from sheet one is within the schedule start and end time record of sheet two. If so, I need to copy the team letter designation into the cell on sheet one.

Sheet 1:
col. A = blank, needs to be filled in with team letter
col. B =time stamp of data event

Sheet 2:
col. A = shift start time
col. B =shift end time
col. C =team letter designation

Thank you.

Hi All
I am using the code below to transfer data from a single sheet to approx'
200 sheets. These sheets are staff training sheets, one per staff member.
This code works great. What I would like to know is, is there a way to then sort the data on these sheets in decending order? I have tried on sheet change but this seems to stop the transfer to other pages.

    Dim shtTemp As Worksheet 
    Dim lngOutRow As Long 
    Dim rngData As Range 
    For Each rngData In Range("A5", Range("A5").End(xlDown)) 
        Set shtTemp = GetWorksheet(rngData.Offset(0, 1).Value) 
        If Not shtTemp Is Nothing Then 
             'copy row across the sheet appending to end
            rngData.EntireRow.Copy shtTemp.Range("A" & shtTemp.Range("A" & shtTemp.Rows.Count).End(xlUp).Offset(1, 0).Row) 
        ElseIf Not Worksheets("Other") Is Nothing Then 
            rngData.EntireRow.Copy Worksheets("Other").Range("A" & _ 
            Worksheets("Other").Range("A" & Worksheets("Other").Rows.Count).End(xlUp).Offset(1, 0).Row) 
            MsgBox "Sheet for " & rngData.Offset(0, 1).Value & " does not exist", vbExclamation 
        End If 
    Range(Selection, Selection.End(xlDown)).Select 
End Sub 
Function GetWorksheet(Name As String) As Worksheet 
     ' return reference to worksheet if it exists
    On Error Resume Next 
    Set GetWorksheet = Worksheets(Name) 
    Exit Function 
End Function 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
The transfered data is placed below the exisiting data.
I need the data sorted decending for a vlookup to work on another sheet.
Any help would be appreciated.

Any help would be greatly appreciated with the following -I have searched for possible solutions but no joy as yet

I have 2 tabs within a workbook. The first tab contains a table and I import information into tab2. What I would like to do is lookup a name in tab2 to see if there is a corresponding name in tab 1 (table array a1:z100) and if there is, to then copy the ROW of infromation (a1:z1) over to tab 2 and paste the information from the lookup cell onwards.

I have tried using vlookup but this only allows for one corresponding value to be shown, and yes I could do this for each cell linking one bit of information at a time but is there a way of matching names and then copy the row of information into tab 2

If anyone could show me how to do this, I would be most grateful. Thanks in advance.

No luck finding an answer? You could always try Google.