Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
I ran into a situation ....
I have several variable declared publicly...
For the purposes of diagnosing my problem, I've added a watch for df_base. As I start stepping through my code in module 1, df_base = "". A routine is called from module 1 in module 2. That routine calculates a value for df_base. The correct calculated value of df_base, 75', is displayed in the watch box for that value. That routine finishes and we are returned to module 1 to resume where we left off. The remainder of the code displays the values of the worksheet. As we resume in module 1 where we left off, df_base still equals 75'.
However, when it reaches the line to display the value in the cell, nothing is populated. When hovering over df_base, it indicates =""
I don't understand why the values of my variables (all of them declared publicly) fail to populate their cells. Here is a portion of the display code:
I have several variable declared publicly...
Code:
Public df_base As String, df_pitch As String, df_bb As String, df_cl As String, df_sm As String, df_sb As String, df_pc As String, df_rl As String, df_sl As String, df_cb As String, df_o1 As String
For the purposes of diagnosing my problem, I've added a watch for df_base. As I start stepping through my code in module 1, df_base = "". A routine is called from module 1 in module 2. That routine calculates a value for df_base. The correct calculated value of df_base, 75', is displayed in the watch box for that value. That routine finishes and we are returned to module 1 to resume where we left off. The remainder of the code displays the values of the worksheet. As we resume in module 1 where we left off, df_base still equals 75'.
However, when it reaches the line to display the value in the cell, nothing is populated. When hovering over df_base, it indicates =""
I don't understand why the values of my variables (all of them declared publicly) fail to populate their cells. Here is a portion of the display code:
Rich (BB code):
With ws_form
'populate
mbevents = False
.Unprotect
If rcode Like "D*" Then
With .Range("K8")
.Validation.Delete
.Value = df_base 'df_base = "" although in the watch it says 75'
.Validation.Add Type:=xlValidateList, Formula1:="=nm_base"
If .MergeCells = True Then
Set mergeRange = .MergeArea
If prow <> 0 Then
mergeRange.Locked = True
Else
mergeRange.Locked = False
End If
End If
End With