How can I set a number for a public variable at userforms in excel

0 votes

I write public X as integer and then X=2. But when I run it, there is an error. what do I write?

Public b as Integer

b=2

Private Sub exa_Click()

range("A" & 3)=b

End Sub

I do not know what can I do

Mar 26, 2023 in Others by narikkadan
• 63,600 points
485 views

1 answer to this question.

0 votes

Try:

Public b As Integer

Private Sub exa_Click()

b = 2

Range("A" & 3) = b

End Sub
answered Mar 26, 2023 by Kithuzzz
• 38,000 points

Related Questions In Others

0 votes
1 answer

How can I use a command button in excel to set the value of multiple cells in one click?

Try this: Private Scan As Integer Private Sub CommandButton1_Click() ...READ MORE

answered Oct 24, 2022 in Others by narikkadan
• 63,600 points
797 views
0 votes
1 answer

How can I sort one set of data to match another set of data in Excel?

In addition, INDEX MATCH is a more ...READ MORE

answered Oct 29, 2022 in Others by narikkadan
• 63,600 points
2,372 views
0 votes
1 answer

How can I format bytes a cell in Excel as KB, MB, GB etc?

In Excel's formatting features, computations are not ...READ MORE

answered Nov 15, 2022 in Others by narikkadan
• 63,600 points
1,941 views
0 votes
1 answer

How can I store the data of an open excel workbook in a collection using BluePrism?

To do what you want is like ...READ MORE

answered Nov 24, 2022 in Others by narikkadan
• 63,600 points
1,402 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
1,259 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,697 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
975 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,690 points
1,090 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP