VBA Microsoft Programming Accessing Variables across slides

TheOuz 21 Reputation points

Hello all, can you help?

I am trying to access a variable from slide 2 in a later slide

in the slide 2 code I have declared the variable as public

Public UserName As String

then I have set the value of this inside my button click function

Public Sub SaveName_Click()
    UserName = TextBox1.Value
End Sub

I am trying to access the variable on a later slide by using


However I am having no luck, can anyone advise me on where I am going wrong?

Thank you in advance

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,630 questions
{count} votes

Accepted answer
  1. Anonymous

    Office development is not currently supported here on QnA. They're actively answering question in dedicated forums here.

    --please don't forget to Accept as answer if the reply is helpful--

    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

0 additional answers

Sort by: Most helpful