VBA Code to activate the tab and and transfer data

Yeshika44

New Member
Joined
Aug 26, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi There

I have to create a Lab Inventory workbook. There are 11 tabs including Master tab. The story is when new items come in, the user must enter the information into the Master Tab (Column A to G), and when the item is transferred to another lab, the person must enter rest of the information into Column H to M. The transfer lab name is selected from a drop-down menu in column "M". My requirement is when the person selects a lab name (Lab 01) from column “M”, specific data (Column A to G) from that row should be moved to the Lab 01 tab, and the same procedure should be followed when transferring items from Lab 01 to another lab.

I am not much knowledgeable with VBA. I would greatly appreciate if anyone can help me to write a VBA code for this. I found following code to use to activate the tab (Lab name) when selected from the column “M” but I don’t have any clue how to transfer data in the same time to the same tab. My spreadsheet is attached here.



Private Sub Worksheet_Change(ByVal Target As Range)

On Error Resume Next

If Not (Application.Intersect(Range("M3:M2000"), Target) Is Nothing) Then _

ThisWorkbook.Sheets(Target.Value).Activate

End Sub




If any of you can help me with this would be much appreciated.

Many thanks

Yeshi
 

Attachments

  • Master Tab.jpg
    Master Tab.jpg
    64.6 KB · Views: 10

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at:
and
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top