tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Everyone,
Its been a while since i've needed to use a userform but could do with some help remembering how to do something that sounds simple.
I have a vba macro that when run perferms a number of comands in a loop (See vba below)
I call Userform2, when it starts.
I want to put a "textbox"? (or whatever you suggest) into Userform" and show the value thats in cell G3
This value changes everytime the loop happens so id like to update the userform?
hope that made sense?
any help would be great
Its been a while since i've needed to use a userform but could do with some help remembering how to do something that sounds simple.
I have a vba macro that when run perferms a number of comands in a loop (See vba below)
I call Userform2, when it starts.
I want to put a "textbox"? (or whatever you suggest) into Userform" and show the value thats in cell G3
This value changes everytime the loop happens so id like to update the userform?
hope that made sense?
any help would be great
VBA Code:
Sub Open_n_Close_Dashboards1()
UserForm2.Show (vbModeless)
Just here I want to load a value into user form from G3
For Each Cl In Projects.Range("A1", Projects.Range("A" & Rows.Count).End(xlUp))
User.Range("G3").Value = Projects.Range("A" & Cl.Row).Value
Just here, I want to UPdate the Userform!!!!!
ProjectName = User.Range("G3").Value & "/"
FolderName = "https://camhcr.sharepoint.com/sites/Finance-Finance-Confidential/Shared%20Documents/Finance%20-%20Confidential/Accounts/Mgmt%20Accounts/Project%20Reports/2022_Projects/"
Filename = User.[G3].Value & "_Dashboard" & ".xlsm"
If Filename = "" Then Exit Sub
Fname = FolderName & ProjectName & Filename
AAA_events_off
Application.ScreenUpdating = False
With Workbooks.Open(Fname, UpdateLinks:=0)
Call SalesUpdate_TW
.Close True
End With
Next Cl
AAA_events_on
Application.ScreenUpdating = True
Application.CutCopyMode = False
Unload UserForm2
MsgBox "Update Done!", , ""
End Sub