Help With Userform Code

glerwell

Well-known Member
Joined
Jun 25, 2006
Messages
1,082
Hi

I have a userform code, I was wondering if it could be streamlined and also if a value in a cell that is used is updated or changed then the userform updates automatically without having to close and rerun the macro to activate the userform to see the updates/changes.

Thanks

Here's the code:

Code:
Private Sub UserForm_Initialize()
Label4.Caption = Worksheets("SYSTEMS").Range("AN10").Value
Label5.Caption = Worksheets("SYSTEMS").Range("AN11").Value
Label6.Caption = Worksheets("SYSTEMS").Range("AN12").Value
Label7.Caption = Worksheets("SYSTEMS").Range("AN13").Value
Label8.Caption = Worksheets("SYSTEMS").Range("AN14").Value
Label9.Caption = Worksheets("SYSTEMS").Range("AN15").Value
Label10.Caption = Worksheets("SYSTEMS").Range("AN16").Value
Label11.Caption = Worksheets("SYSTEMS").Range("AN17").Value
Label12.Caption = Worksheets("SYSTEMS").Range("AN18").Value
Label13.Caption = Worksheets("SYSTEMS").Range("AN19").Value
Label14.Caption = Worksheets("SYSTEMS").Range("AN20").Value
Label15.Caption = Worksheets("SYSTEMS").Range("AN21").Value
Label16.Caption = Worksheets("SYSTEMS").Range("AN22").Value
Label17.Caption = Worksheets("SYSTEMS").Range("AN23").Value
Label18.Caption = Worksheets("SYSTEMS").Range("AN24").Value
Label19.Caption = Worksheets("SYSTEMS").Range("AO10").Value
Label20.Caption = Worksheets("SYSTEMS").Range("AO11").Value
Label21.Caption = Worksheets("SYSTEMS").Range("AO12").Value
Label22.Caption = Worksheets("SYSTEMS").Range("AO13").Value
Label23.Caption = Worksheets("SYSTEMS").Range("AO14").Value
Label24.Caption = Worksheets("SYSTEMS").Range("AO15").Value
Label25.Caption = Worksheets("SYSTEMS").Range("AO16").Value
Label26.Caption = Worksheets("SYSTEMS").Range("AO17").Value
Label27.Caption = Worksheets("SYSTEMS").Range("AO18").Value
Label28.Caption = Worksheets("SYSTEMS").Range("AO19").Value
Label29.Caption = Worksheets("SYSTEMS").Range("AO20").Value
Label30.Caption = Worksheets("SYSTEMS").Range("AO21").Value
Label31.Caption = Worksheets("SYSTEMS").Range("AO22").Value
Label32.Caption = Worksheets("SYSTEMS").Range("AO23").Value
Label33.Caption = Worksheets("SYSTEMS").Range("A024").Value
Label34.Caption = Worksheets("SYSTEMS").Range("AP10").Value
Label35.Caption = Worksheets("SYSTEMS").Range("AP11").Value
Label36.Caption = Worksheets("SYSTEMS").Range("AP12").Value
Label37.Caption = Worksheets("SYSTEMS").Range("AP13").Value
Label38.Caption = Worksheets("SYSTEMS").Range("AP14").Value
Label39.Caption = Worksheets("SYSTEMS").Range("AP15").Value
Label40.Caption = Worksheets("SYSTEMS").Range("AP16").Value
Label41.Caption = Worksheets("SYSTEMS").Range("AP17").Value
Label42.Caption = Worksheets("SYSTEMS").Range("AP18").Value
Label43.Caption = Worksheets("SYSTEMS").Range("AP19").Value
Label44.Caption = Worksheets("SYSTEMS").Range("AP20").Value
Label45.Caption = Worksheets("SYSTEMS").Range("AP21").Value
Label46.Caption = Worksheets("SYSTEMS").Range("AP22").Value
Label47.Caption = Worksheets("SYSTEMS").Range("AP23").Value
Label48.Caption = Worksheets("SYSTEMS").Range("AP24").Value
End Sub
 
Why do you need to add it to the clipboard?:confused:

Could you please give us some more information?
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I would like to add it to the clipboard because I will use that value in different sheets. So if it in the clipboard it will save time rewriting it.
 
Upvote 0
There is no need to add it to the clipboard.

Please give more information on what you are actually trying to do.

I'm afraid if you don't then people aren't going to be able to help much.:)
 
Upvote 0
I want to copy it to the clipboard. If I used the original cell to "COPY", I could paste the value in another cell, no problem. The reason I don't do this is because the original values are hidden. The reason behind the userform, is so I can see the data when I switch through different sheets. When Im on the approiate sheet I would like to able to copy the highlighted value in userform and paste it in a relevant cell.

Hope this clears it up because I can't see where the confusion lies.
 
Upvote 0
There should be no need to copy to the clipboard.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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