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
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

ndjustin20

Board Regular
Joined
May 25, 2011
Messages
69
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!!!
 

Smitty

MrExcel MVP
Joined
May 15, 2003
Messages
29,536
Believe me, you're not the only one who got a nasty surprise!
 

Watch MrExcel Video

Forum statistics

Threads
1,095,150
Messages
5,442,675
Members
405,191
Latest member
wedloski

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top