Public Declaration is not public

USAMax

Well-known Member
Joined
May 31, 2006
Messages
843
Office Version
  1. 365
Platform
  1. Windows
I have declared several variables as public but FstCvcCol will not work publicly. Can anyone tell me why?

Code:
Public Type myType
    RowColId As Long
    cellStr As String
End Type

Public GlobalArray(100) As myType
Public IndentLevel As Integer                               'Index Level for task Flow worksheet
Public FstSvcCol As Integer                                 'First Service Column for task Flow worksheet
 
Last edited by a moderator:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You haven't posted whatever doesn't work.

The code needs to be in a standard code module, not ThisWorkbook, or a sheet module, or a forms module.
 
Upvote 0
This is posted in a standard module, in fact the module is still named Module4. The strange thing is that all the other Declarations work as they should, only FstSvcCol doesn't work. In this module I set the value to 1 and when I get to the user form the value is empty. I set IndentLevel to one and it passes to two routines in another user form.
 
Upvote 0
You still have not posted the problematic code.

Have you declared the variable in more than one place? Does Option Explicit appear at the top of every module? (You've spelled the variable two different ways.)

I can make 20 guesses, or you could make it simple.
 
Last edited:
Upvote 0
I know it was a typo here but I could not find a typo in my code. I changed everything from FstSvcCol to FSC and it works. It stands for First Service Column and that would be easy to figure out but I will have to take what works. I used a find and replace to do the work so it wasn't a typo.

Thank you for the effort shg.
 
Upvote 0
If that worked it sounds like a duplicate declaration.
 
Upvote 0

Forum statistics

Threads
1,216,033
Messages
6,128,427
Members
449,450
Latest member
gunars

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