Referring an active cell in a worksheet to another worksheet - excel

I have a worksheet (let me call it WorksheetA) that each row has a different information. Then, I want to refer these information (per row) on my other worksheet (WorksheetB).
To explain further, WorksheetA has 2 columns that should be copied to WorksheetB. These are "Name" and "School Last Attended". I want to know how can WorksheetB be updated every time a new row in WorksheetA is filled. Also, there will only be one cell on WorksheetB to hold values for the column "Name" from WorksheetA and another one cell (WorksheetB) for column "School Last Attended" from WorksheetA.
It will be really helpful if the answer to this question is within the environment of Excel, that I won't have to require any other software/program.
Thanks in advance!! :)

OK I may may not have interpreted this correctly but here goes.
In Sheet1 (your Worksheet A) we have two columns of data which are updated by adding to the end of the list:
In Sheet2 (your Worksheet B) there are two cells (B4 and D4 in this example) that hold and will continually update with the LAST details held in the Sheet1 list.
To achieve this ON:
SHEET2 in cell B4 enter: =INDIRECT("'" & B1 & "'!B" & COUNTA(Sheet1!B:B))
SHEET2 in cell D4 enter: =OFFSET(INDIRECT("'" & B1 & "'!B" & COUNTA(Sheet1!B:B)),0,1)
Edit (in hindsight)
Note that you must include the name of the data worksheet in cell B1 of sheet2 - this is required for the INDIRECT function to operate across sheets.
Note also that there should be no blank rows in the block of data in Sheet1 - this is because the last data value in col B is being found using COUNTA

Related

value in this form "ws$B$16", get the data of that entire row upto column Z output to master ws C2. Value of ws & cell changes depend on search info

Still a newbie with VBA coding. I have a code to search input text or word (ignore case sensitive) from a multiple worksheet, text/word can be within a word (ex. ben from Benjamin). So far, i have the result of search in column B2, C2, D2 and so on until done. the value in column B2, C2, D2 have same format WS.name & cell address in the form of dog$B$, cat$D$32, horse$F200, etc. I want the Display output into a Master worksheet to column A3:whatever. The output should consist of that entire row including bland cell upto column Z. Also if the worksheet name is calling for "chart" I also need the value of the rows from 3 rows before and 2 rows after.

Autofill Excel if A1 = sheet2 A1 then B1 = Sheet2 B2

I am maintaining an excel sheet where Sheet1 A1 would be the name of people and B2 would be their contact number. All of the details are in sheet 2 row A and B.
So, what I want is if I put a valid name (i.e. should be in Sheet2 A) then it automatically finds the number of that name and adds in the second row. Is this possible? I have around 10-15 contacts there.
Assuming Sheet workers list is as follows:
then in Cell B2 of Sheet assignment received enter either of the following formulas
=VLOOKUP(A1,'workers list'!A2:B10,2,FALSE)
or
=INDEX('workers list'!B2:B10,MATCH(A1,'workers list'!A2:A10,0))
Change range as required.
Use this formula in sheet -1 B2 cell "=IF(A2="","",VLOOKUP(A2,Sheet2!$A:$B,2,0))"
and Dropdown this formula till you want
Sheet-2
Sheet-1

Updating Sheet2 as I enter new data on Sheet1

I have some data on Sheet1 from B2:G5480. I also have the same data on Sheet2 from B2:G5480 for separate calculations.
What I want is as I enter new rows on Sheet1 updating Sheet2 automatically.
Any help will be appreciate.
Method 1:
Make cells in sheet2 point to cells in sheet1
For example in Sheet2 cell A1 have formula =Sheet1!A1
Replicate this principle across the range B2:G5480, being sure not to overwrite formula cells
Method 2:
Make formulae in Sheet2 refer to data in Sheet1 by prefacing cell references with Sheet1! - leave all data on sheet1 in just one place.

Excel creating additional sheets by copying but keeping formula

I have a workbook (we are using them for electronic purchase orders) and I need to be able to copy a worksheet but have the formula in it increment like it would if I copied the formula in a sheet.
In other words in sheet2 I1 the formula is ='Sheet1'!$I$1+1. When I copy sheet2 and it becomes sheet3, I need the formula in I1 to say ='Sheet2'!$I$1+1.
How can i do this?
You can get a string containing the current sheet name with the following formula
=cell("filename",A1)
If you are using the standard Sheet# for your pages, then you can get the current sheet number with this formula (assuming the previous one was in B3)
=RIGHT(B3,LEN(B3) - FIND("]Sheet",B3,1)-5)
Next calculate the number for the previous sheet
=VALUE(B4)+1
Now you can use the indirect function to address a cell in the previous sheet
=INDIRECT("Sheet"&B5&"!B1")
In Sheet4, this will reference B1 in Sheet3.
Copy it to Sheet5 and it will reference B1 in Sheet 4.

Copy cells from one sheet, paste into a second sheet in the correct place based on a VLOOKUP

I have a submission form, Sheet1, and a datasheet that does calculations, Sheet2. Sheet2 contains a list of Names and Dates and empty cells ready to be filled.
On Sheet1, the user selects a Name from a list in A2 (using data validation, with the source being a 3rd reference sheet), then enters values in C1, D1, E1, F1, etc. The user then clicks a button that prints the form sheet, Sheet1.
I also want to also transfer the data from C1, D1, E1 etc into Sheet2, and slot them into the correct row, which is which ever row has the corresponding Name entered in Sheet1!B1 in Sheet2!A1.
I'm comfortable with VBA copying defined cells to other defined cells, but am unsure of how to combine that with finding the correct position in Sheet2 based on the value in A. Below are Sheet1 and Sheet2.
Please modify to suit your requirement
Sub copyrange()
Dim sheet2_row As Integer
sheet1_name = Sheets("Sheet1").Cells(2, 2).Value
sheet2_row=WorksheetFunction.Match(sheet1_name,Sheets("Sheet2").Range("A1:A10"), 0)
Sheets("Sheet1").Range("C2:AG2").Copy
Sheets("Sheet2").Range("B" & sheet2_row & " : AF" & sheet2_row).PasteSpecial xlPasteValues
End Sub

Resources