ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i link rows in different worksheets? (https://www.excelbanter.com/excel-worksheet-functions/124099-how-do-i-link-rows-different-worksheets.html)

walke323

how do i link rows in different worksheets?
 
I was wondering if anyone here knows how to somehow 'link' rows in one
worksheet to a row in another worksheet, almost as if they were pegged
together. I have a worksheet that has a list of inventory: one worksheet is
all the buying details (date paid, amount paid, etc), while the other is all
of the selling details (date sold, amount sold for, etc). Right now, I have
the names of the merchandise in the second sheet (which is the selling sheet)
copied and pasted via formula (i.e. A1 on the selling sheet=BUY!A1), so that
I don't have to enter the namesing twice and so that all the information on a
row in either sheet relates to the same item. However, if I wanted to delete
a certain row (or even worse, add one), in the middle, I'd have to manually
do the same thing on the other sheet as well. And forget about re-sorting
everything without a whole lot of work.

So, basically what i want to know is if there is a function or formula that
'pegs' the rows in one sheet to the respective row in another sheet, so that
if I delete a row or change the items location on the list (or want to sort
based on all parameters of both sheets), it will change on the other sheet as
well.

Essentially, I need it so that two worksheets acts as one, while still
having separate worksheets (if that's possible).

aaron

Martin Fishlock

how do i link rows in different worksheets?
 
Aaroon

Assuming that the relationship is a one to one that is for any one product
you only have one line in the purchases (latest?) and the latest selling
details in the selling sheet.

One possible solution is to have one sheet with a button at the top to
switch between the sales and the purchases columns.

That way you only have to maintain one list.


The code for hiding columns is assuming you have three buttons

Show All, Show Purchases, Show Sales

Sub ShowAll()
ActiveSheet.Columns.Hidden = False
End Sub

Sub ShowSales()
' hide purchases
ShowAll
ActiveSheet.Columns("C:E").Hidden = True
End Sub

Sub ShowPurchases()
' hide sales
ShowAll
ActiveSheet.Columns("F:H").Hidden = True
End Sub

You copy the above into a module in the workbook where your worksheet is and
them assign the macro to the form buttons.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"walke323" wrote:

I was wondering if anyone here knows how to somehow 'link' rows in one
worksheet to a row in another worksheet, almost as if they were pegged
together. I have a worksheet that has a list of inventory: one worksheet is
all the buying details (date paid, amount paid, etc), while the other is all
of the selling details (date sold, amount sold for, etc). Right now, I have
the names of the merchandise in the second sheet (which is the selling sheet)
copied and pasted via formula (i.e. A1 on the selling sheet=BUY!A1), so that
I don't have to enter the namesing twice and so that all the information on a
row in either sheet relates to the same item. However, if I wanted to delete
a certain row (or even worse, add one), in the middle, I'd have to manually
do the same thing on the other sheet as well. And forget about re-sorting
everything without a whole lot of work.

So, basically what i want to know is if there is a function or formula that
'pegs' the rows in one sheet to the respective row in another sheet, so that
if I delete a row or change the items location on the list (or want to sort
based on all parameters of both sheets), it will change on the other sheet as
well.

Essentially, I need it so that two worksheets acts as one, while still
having separate worksheets (if that's possible).

aaron



All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com