FreeWeekCnt

sprucethebruce

Board Regular
Joined
Jul 22, 2010
Messages
78
Does anyone use this in VBA?

I've got a macro I'm trying to modify and replicate to another spreadsheet and this is the one stumbling block I have, can't seem to find it on Google either (which is a worry).

Is it a counting date code or something, would make sense, I suppose I need to know how it works as well.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Code:
' check to see if 20 weeks of history stored
    FreeWeekCnt = 0
    Range("D88:D107").Cells.Select
    For Each cel In Selection
        If cel.Value = "" Then FreeWeekCnt = FreeWeekCnt + 1
    Next

' if 20 weeks history stored, delete first entry and move records up,
'   filldown last row, to copy formats (but clear values)
    If FreeWeekCnt = 0 Then
        Range("D88:F88").Delete (xlShiftUp)
        Range("D106:F107").FillDown
        Range("D107:F107").ClearContents
        Call resetChartRange
    End If
 
Upvote 0
Looks like it's just a variable to count the number of cells between D88 and D107 that aren't blank.
 
Upvote 0
As Neil pointed out, it's just a variable.
You could replace "FreeWeekCnt" with "BlankCounter" or something just as descriptive, if you wanted to.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,261
Members
452,901
Latest member
LisaGo

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