Sheet doesn't display correctly after macro runs

Sheet doesn't display correctly after macro runs

Hi there,

I'm using the following code as part of a macro in one of my sheets, to record information from one worksheet into another:

   Sub LogTaskComplete(ByVal taskName As String)
  
      Dim currentSheet As String
      currentSheet = ActiveSheet.Name
      Worksheets("Log").Activate

      Application.EnableEvents = false
      Rows(TITLE_ROW+1).Insert
      Cells(TITLE_ROW+1, LOG_TASK_COL).value = taskName
      Cells(TITLE_ROW+1, LOG_DATE_COL).value = Now()
      Application.EnableEvents = true      
  
      Cells(TITLE_ROW+1, LOG_TASK_COL).Font.Bold = False
      Cells(TITLE_ROW+1, LOG_DATE_COL).Numberformat = "h:mm a EEE mmm d, yyyy"
      Cells(TITLE_ROW+1, LOG_DATE_COL).Font.Bold = False   
      Worksheets(currentSheet).Activate  
  
   End Sub

After running the code, the changes are invisible in the workbook. When I switch tabs within Zoho Sheet to the "Log" worksheet, it is as though nothing has changed (except the line showing the first three rows are frozen is invisible).

The data appears to be stored correctly - because if I reload the whole sheet (by reloading the browser window, or closing the browser tab and opening the Zoho Sheet again) all the data is there. The only way to see any of the newly added data without reloading the page in the browser is to change the font colour or background colour of cells in the "Log" worksheet. I am using Firefox version 87.0 (64-bit).

Is there an extra line I am missing in my VBA code to refresh the screen? Or is this a different problem?

Many thanks,

Victoria
    • Sticky Posts

    • Refine by Zia: a smart way to improve data quality

      Zia in Zoho Sheet has been helping users with recommended charts, pivot tables, and offering insights about their data. While there is an exclusive smart data cleaning tool, from now on Zia will also include data quality suggestions for error-free analysis,
    • Webinar: Learn how to instantly clean your spreadsheet data

      Hello! Do you find it tedious to get rid of duplicate entries, inconsistencies, and missing values in your data? Join our webinar and learn the trick to clean up your data in an instant. In this session you'll be introduced to the smart data cleaning tool in Zoho Sheet followed by a live demonstration.  ​ In this session, you'll get to know: What's new in Zoho Sheet About a smart tool to clean your spreadsheets in an instant How to find and remove duplicate records from your data How to get rid of
    • Announcing IMPORTRANGE and cross-spreadsheet linking in Zoho Sheet

      We are pleased to announce the much-requested IMPORTRANGE function in Zoho Sheet. With this function, you can now link or refer to cell ranges across spreadsheets in an instant.   Refer across spreadsheets You can use IMPORTRANGE just like any other predefined function in Zoho Sheet. Start with an equal sign, select the function, and fill in the parameters. For this function, the source spreadsheet link and the desired cell range to import are given as input.     Once you allow access to the source
    • Tab Colors and New Currency Symbol of Indian Rupee

      Zoho Sheet has recently added support for the following 2 new features: Tab Colors: Since last month, you can set a color to your worksheet tabs. Use colors to quickly identify/highlight specific worksheets or to group similar worksheets together. This option is available on the right click context menu of the worksheet tab. Add color to your worksheets! Indian Rupee Currency - New Symbol: The new Indian Rupee Symbol, ₹, is now supported in Zoho Sheet. This replaces the old "Rs." currency symbol
    • Expanding and securing ways to share your spreadsheet: email as attachment and password protection

      While Zoho Sheet allows you to share and collaborate with your colleagues in real time, you might wish to send your spreadsheets as email attachments or keep an offline version of a confidential file with password protection. Here's how our new options

      Zoho SalesIQ Resources



            Zoho TeamInbox Resources

              Zoho DataPrep Resources


                  Zoho CRM Plus Resources

                    Zoho Books Resources


                      Zoho Subscriptions Resources

                        Zoho Desk Resources

                          Zoho Projects Resources


                            Zoho Sprints Resources


                              Qntrl Resources


                                Zoho Creator Resources


                                  Zoho WorkDrive Resources




                                      Zoho Campaigns Resources

                                        Zoho CRM Resources

                                                    Design. Discuss. Deliver.

                                                    Create visually engaging stories with Zoho Show.

                                                    Get Started Now


                                                      Zoho Show Resources


                                                        Zoho Writer Writer

                                                        Get Started. Write Away!

                                                        Writer is a powerful online word processor, designed for collaborative work.

                                                                  有料プランをご利用の方