Excel 2013 VBA ActiveSheet

ndjustin20

Board Regular
Joined
May 25, 2011
Messages
69
I am having an issue with the following code block. Works fine in Excel 2010 but will not work in excel 2013. Is there an issue with OLE Control Objects in 2013 VBA or am I missing something. The code stops at "ActiveSheet.monthOneBudTxt.Value = Format(Range("JanBud").Value, "$###,###")" and returns an error of:
Run-Time error 438 Object doesn't support this property or method

Code:
Sub firstQtrByMonth()

    'MsgBox "The name of the active sheet is " & ActiveSheet.Name
      

    ActiveSheet.monthOneBudTxt.Value = Format(Range("JanBud").Value, "$###,###")
    ActiveSheet.monthOneLabel.Value = "Jan"
    ActiveSheet.monthTwoBudTxt.Value = Format(Range("FebBud").Value, "$###,###")
    ActiveSheet.monthTwoLabel.Value = "Feb"
    ActiveSheet.monthThreeBudTxt.Value = Format(Range("MarBud").Value, "$###,###")
    ActiveSheet.monthThreeLabel.Value = "Mar"
    
    ActiveSheet.monthOneActTxt.Value = Format(Range("JanAct").Value, "$###,###")
    ActiveSheet.monthTwoActTxt.Value = Format(Range("FebAct").Value, "$###,###")
    ActiveSheet.monthThreeActTxt.Value = Format(Range("MarAct").Value, "$###,###")
    
    
    ActiveSheet.monthOneIncDecTxt.Value = Format((ActiveSheet.monthOneActTxt.Value / ActiveSheet.monthOneBudTxt.Value), "#%")
    ActiveSheet.monthTwoIncDecTxt.Value = Format((ActiveSheet.monthTwoActTxt.Value / ActiveSheet.monthTwoBudTxt.Value), "#%")
    ActiveSheet.monthThreeIncDecTxt.Value = Format((ActiveSheet.monthThreeActTxt.Value / ActiveSheet.monthThreeBudTxt.Value), "#%")
    
    'ActiveSheet.monthlyBreakDownHeader.Value = "1st Qtr Monthly Breakdown"
    
    'ActiveSheet.quarterlyBreakdownHeader.Value = "1st Qtr Analysis"
    
    ActiveSheet.QtrBudTotal.Value = Format(ActiveSheet.monthOneBudTxt.Value + ActiveSheet.monthOneBudTxt.Value + _
    ActiveSheet.monthOneBudTxt.Value, "$###,###")
    
    ActiveSheet.QtrActTotal.Value = Format(ActiveSheet.monthOneActTxt.Value + ActiveSheet.monthOneActTxt.Value + _
    ActiveSheet.monthOneActTxt.Value, "$###,###")
    
    ActiveSheet.monthOneVariance.Value = Format(ActiveSheet.monthOneActTxt.Value - ActiveSheet.monthOneBudTxt.Value, "$###,###")
    ActiveSheet.monthTwoVariance.Value = Format(ActiveSheet.monthTwoActTxt.Value - ActiveSheet.monthTwoBudTxt.Value, "$###,###")
    ActiveSheet.monthThreeVariance.Value = Format(ActiveSheet.monthThreeActTxt.Value - ActiveSheet.monthThreeBudTxt.Value, "$###,###")
    
    
    'ActiveSheet.cisCompBreakDownHeader.Value = "First Quarter CIS Comparison"


End Sub
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Smitty!!!!!!! Thank you for the help!!!!! I've been trying and retrying so much to try and figure this out. I know the code did work but just couldn't for the life of me figure out why it suddenly stopped working. Very odd for sure.


Thanks Again!!!
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

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