Please help! How can i do this?

htoh2

New Member
Joined
Oct 20, 2010
Messages
25
Greetings to all experts,

I'm a novice in visual basic, hence i would like to seek some advices from the experts. I would appreciate if you can help me on this issue:

I have 2 excel workbooks, 1st will be EndUserFile.xls, and it have 3 columns of data as below:

Country Code Business Positions Company code
CC1 Manager
CC2 Admin Clerk
CC3 Officer
CC4 Manager

2nd workbook will be Lookup.xls file with the following data:

Country Code Company Code
CC1 ABC
CC1 CDE
CC1 FGH
CC1 JKL
CC2 KKK
CC2 LLL
CC3 001
CC3 002
CC3 003

And my requirement using macro is:

When we filter Country code = "CC1" in EndUserFile.xls , upon clicking a button, the values of company codes (e.g.ABC,CDE,FGH,JKL) for country code e.g. "CC1" from Lookup.xls is copied and these values are updated back to the company code column in EndUserFile.xls

Experts, pls kindly guide me.:confused:

Feel free to clear any doubts with me.:LOL:

Thanks a millions :)

Best Regards,
htoh2
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi experts,

I'm trying to use array and i've found some codes regarding storing the variables.
So i'm not sure if i could use it to perform my requirement.

These are some codes, in case you may need to go through it :

Sub TestDynamicArray()
' stores all names in the workbook in the array variable MyNames()
Dim MyNames() As String ' declares a dynamic array variable
Dim iCount As Integer
Dim Max As Integer
Max = ThisWorkbook.Names.Count ' finds the maximum array size
ReDim MyNames(1 to Max) ' declares the array variable with the necessary size
For iCount = 1 To Max
MyNames(iCount) = ThisWorkbook.Names(iCount)
Next iCount
Erase MyNames() ' deletes the varible contents, free some memory
End Sub

From the source : http://www.exceltip.com/st/Array_variables_using_VBA_in_Microsoft_Excel/509.html


i've tried to edit it according to my needs, but to no avail.:confused:

Pls kindly help me out, thank you so much :)

Regards,
htoh2
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,376
Members
449,080
Latest member
Armadillos

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