Object required error

Object required error

Hi,

I am getting an 'Object required' error on the line

Call HideColumnsOutsideRange(ws, startOfWeek, endOfWeek) 

when I run the ShowCurrentWeek macro but not when I run the ShowCurrentMonth macro. 

Any ideas?

Regards,
GW

Option Explicit

Sub HideColumnsOutsideRange(ws as Worksheet, startDate As Date, endDate As Date)
    Dim lastCol As Long
    Dim c As Long
    Dim hdr As Variant
    Dim dt As Date

    ' Find last used column in row 1
    Application.ScreenUpdating = False

    ws.Cells.EntireColumn.Hidden = False
    
    lastCol = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column

    For c = 1 To lastCol
        hdr = ws.Cells(1, c).Value

        If IsDate(hdr) Then
            ' Normalize to pure date (drop time / timezone artifacts)
            dt = DateSerial(Year(CDate(hdr)), Month(CDate(hdr)), Day(CDate(hdr)))
            ' Debug.print "dt: " & dt & " start: " & startDate & " end: " & endDate
            ' Hide if outside the given range
            If (dt < startDate) Or (dt > endDate) Then
                ws.Columns(c).Hidden = True
            End If
        Else
            ws.Columns(c).Hidden = True
        End If
    Next c

    Application.ScreenUpdating = True
End Sub

Sub ShowCurrentMonth()
    Dim ws As Worksheet
    Dim today As Date, startOfMonth As Date, endOfMonth As Date

    Set ws = ActiveSheet
    today = DateValue(Now)

    startOfMonth = DateSerial(Year(today), Month(today), 1)
    endOfMonth   = DateSerial(Year(today), Month(today) + 1, 0)

    Call HideColumnsOutsideRange(ws, startOfMonth, endOfMonth)
End Sub

Sub ShowCurrentWeek()
    Dim ws As Worksheet
    Dim today As Date, startOfWeek As Date, endOfWeek As Date

    Set ws = ActiveSheet
    today = DateValue(Now)

    startOfWeek = today - (Weekday(today) - 1)  ' Sunday–Saturday
    'Debug.Print "startOfWeek: " & startOfWeek
    endOfWeek = startOfWeek + 6

    Call HideColumnsOutsideRange(ws, startOfWeek, endOfWeek)
End Sub

      • Sticky Posts

      • Introducing Forms in Zoho Sheet

        We hereby bring you the power of ​forms in Zoho Sheet. ​Now, build and create your own customized forms using Zoho Sheet. Be it compiling a questionnaire or rolling out a survey, Zoho Sheet can do it all for you. Forms is an excellent feature that helps you collect information in the simplest of ways and having it in Zoho Sheet takes it a notch higher. Build Simple yet Powerful forms Building forms using Zoho Sheet is fairly simple. The exclusive 'Form' tab lets you create one quickly. Whether you
      • Meet the latest feature of Zoho Sheet: Lock Cells

        We are happy to announce the release of one of the most awaited features in Zoho Sheet. ​You can now lock the cells that you wish to keep ​secure. Once you are done with editing cells, you can lock them so that they won't be modified anymore. We believe that this feature will be a great addition to our existing set of collaboration features and is intended to improve your collaboration experience. You can access this new feature Lock from Data tab. Apart from being able to lock individual cell ranges,
      • Feature enhancement: Highlight rows based on a cell value

        Hello Sheet users, We're excited to announce a new feature enhacement, shaped directly by your valuable feedback! As you might know, conditional formatting is a great tool for anyone dealing with large data sets. Previously, if you’ve ever wanted to draw
      • Revamped Print in Zoho Sheet—customized for paper

        The latest enhancements to Zoho Sheet's Print settings allows you to print a worksheet or a selected range, with customizations that make the data comprehensible, even on paper.   Customize header and footer Make your spreadsheets meaningful with a relevant header and footer. You can now choose to display the file name, sheet name, current page number, total pages, date, and time as the header and footer in your print view. Besides the predefined elements, you can also give a custom text for header/footer.
      • Slicers are now available in Zoho Sheet—filter your data interactively

        At Zoho Sheet, we diligently track user requests and feedback. In line with this, based on extensive user requests, we've integrated Slicers to pivot tables and are delighted to announce its release. Slicers are interactive visual filters that have add,

        • Recent Topics

        • Zoho People Attendance Module - Split Shifts

          Hello, Our business employs a number of college students who often split their workdays between work hours and class schedules, resulting in split shifts. For example: Employee 1 works 9am to 11:30am and then leaves for class, returning to work at 3pm
        • Zoho One subscription

          we have got Zoho CRM for 3 users and we paid for the app , and we have still 9 months to go , but if we join Zoho one , does it mean the payment for that subscription would be a waste? Please help. Thanks.
        • How Zoho CRM Can Enhance Your Faucets Accessories Business Operations?

          In today's competitive market, having a reliable CRM system is crucial for managing customer relationships and streamlining business operations. For businesses in the faucets accessories niche, Zoho CRM offers powerful tools to help manage everything
        • Dashboard

          I’m currently working on a project using the Zoho IoT Cloud with an ESP32 and MQTT. I’ve successfully connected the ESP32 to Wi-Fi and MQTT, and the data from the ESP32 is displayed in the telemetry section of the cloud. However, when I try to create
        • Can i connect 2 instagram accounts to 1 brand?

          Can i connect 2 instagram accounts to 1 brand? Or Do i need to create 2 brands for that? also under what subscription package will this apply?
        • Zoho Forms - Improved Sub-Forms

          Hi Forms team, I'm helping a client move from JotForms to Zoho Forms and I've found another opportunity for improvement. In the below screenshot, JotForm left and Zoho Forms right. The Zoho Forms Sub-Form is quite a poor visually. There is no way to make
        • What's New in Zoho Billing | Q3 2025

          Hello everyone, We are excited to share the latest set of updates and enhancements made to Zoho Billing in Q3 2025. From the latest GST updates to multi-level discounting, Zia-powered report summaries, and customizable web forms, these updates are designed
        • How to Delete Personal Account Linked with My Mobile Number in past or by someone else

          How to Delete Account Created with My Mobile Number in past or by someone else This is creating issues in making or sync with my credentials mobile and email address..
        • WhatsApp Business Calling API

          Dear Zoho SalesIQ Team, I would like to request a feature that allows users to call WhatsApp numbers directly via Zoho SalesIQ. This integration would enable sending and receiving calls to and from WhatsApp numbers over the internet, without the need
        • Does Zoho Learn integrate with Zoho Connect,People,Workdrive,Project,Desk?

          Can we propose Zoho LEarn as a centralised Knowledge Portal tool that can get synched with the other Zoho products and serve as a central Knowledge repository?
        • Marketer's Space - Going beyond basics: Smarter ecommerce marketing with Zoho Campaigns

          Hello Marketers, Welcome back to this week's Marketer's Space. In the last post, we discussed the basics of email marketing and how to get started with email marketing in ecommerce. In this part, we'll dive much deeper into some other advanced features
        • Connecting two modules - phone number

          Hi, I’d like some guidance on setting up an automation in Zoho CRM that links records between the Leads module and a custom module called Customer_Records whenever the phone numbers match. Here’s what I’m trying to achieve: When a new Lead is created
        • Zoho Marketing Automation 2.0 - Landing Page function not working

          Dear Zoho Team, I am working on implementing Zoho Marketing Automation 2.0, and am now looking into the section "Lead Generation". If I open the "Landing Pages" section, I immediately get an Error code: Error: internal error occurred. Can you help me
        • Unable to use Sign "You have entereed some invalid characters"

          Unable to use Sign "You have entered some invalid characters" I do not see any invalid characters. The text in "Leave a Note" is plain text which I entered directly into the field. See attached screenshot
        • Elevate your CX delivery using CommandCenter 2.0: Simplified builder; seamless orchestration

          Most businesses want to create memorable customer experiences—but they often find it hard to keep them smooth, especially as they grow. To achieve a state of flow across their processes, teams often stitch together a series of automations using Workflow
        • Messages not displayed from personal LinkedIn profile

          Hello. I connected both our company profile and my personal profile to Zoho social. I do see all messages from our company page but none from my private page. not even the profile is being added on top to to switch between company or private profile,
        • "Performed changes in the query is not allowed due to following reason" when adding columns or reordering data

          I'm trying to make changes to a query but every time i try to save it i get this error message. I'm not touching the data it's flagging. All I've tried to do is reorder a couple of fields and add a new one. Why won't it let me do this? It's a core query
        • Onboard new users easily with native screen recording in Zoho Projects Plus

          Communication involving both visual and audio elements tends to capture more interest among the audience. Whenever we onboard new employees to the organization, the task of engaging them in the induction sessions, and keeping the spark going in their
        • Request to Add Support for PDF Templates and More Flexibility in Email Editor

          Hi Zoho Campaigns Team, I hope you're doing well. I wanted to share some feedback and request a few improvements in the Email Template feature of Zoho Campaigns. Right now, we can create email templates using the HTML editor, which is helpful. But we’re
        • Can you stop Custom View Cadences from un-enrolling leads?

          I'm testing Cadences for lead nurture. I have set un-enroll properties to trigger on email bounce/unsubscribe, and do NOT have a view criteria un-enroll trigger. However, help documents say that emails are automatically un-enrolled from a Cadence when
        • Zoho Desk Android and iOS app update: Agent detail overview

          Hello everyone! We’ve introduced agent detail overview on the Zoho Desk Android and iOS app update. With this feature, you can get a complete view of agent’s tickets, response times, logged hours (for both tickets and activities), customer happiness ratings
        • Blog Widget: Show recent blog posts on my homepage

          Hey there I am using the Zoho Sites Blog feature. On my homepage, on the bottom I'd like to have a featured content section where I show some of my blog posts (selected, most recent, filtered by category and so on...). It would be nice to have a blog
        • YouTube Live #2: Agreement Intelligence with Zoho Sign's eSign AI assistant

          Hi there, We're back again with our YouTube live series and this time, we'll take you through our holistic agreement intelligence powered signature workflows. Struggling to draft an agreement? Need help double-checking clauses and going through complicated
        • How to iterate through excel data using zoho rpa

          I wanted to iterate or loop through excel data ( datatable). How can i do that
        • Update on the client portal URL for Guest users

          We’re updating the way Guest users access their Connect network. As part of this change, all client organization portals used by Guest users will now be accessible through a dedicated domain specific to each data center. The access URLs mentioned here
        • Zoho Commerce

          Hi, I have zoho one and use Zoho Books. I am very interested in Zoho Commerce , especially with how all is integrated but have a question. I do not want my store to show prices for customers that are not log in. Is there a way to hide the prices if not
        • Mass (Pull back) (Close WOs) (Close APs)

          Hi develop team. Just idea because Zoho FSM is great but its too manual. we have a lot of task to do every day and the system needs to have more features to automatic our tasks. I need to close several WOs, APs and Pull Back per day. Please we need mass
        • Customising Zohidesk portal default widgets

          Hello, I'm wondering how could I customise the default widgets such as "popular topics", "popular articles" using CSS or to make the tiles at the bottom match the ones that I made in the picture attached. I have made some custom widgets and edited them
        • If there’s a batch at the end, the ‘mark as inactive’ function doesn’t work.

          when my batch has a date to batch end and I "mark as inactive" he batch does not obey the status and reactivates the batch.
        • Seamless multilingual messaging and tone control in Zia IM Composer

          Hello everyone! Managing customer conversations across multiple languages can be time-consuming. Using Zia in the Instant Messaging (IM) Composer helps you overcome this by providing tools to translate content, adjust your tone, and refine your messages
        • Advanced Deluge help needed with custom function and COQL limits

          I have a scheduled function that takes a snapshot of specific metrics and saves them to a custom module. However I'm struggling with the limits of COQL. I attach my full code, but an example of the issues I'm having is that it's erroring with a 'Limit
        • Tip of the Week - Conditional Formatting Chart

          Conditional formatting allows you to highlight your data series based on a pattern or a trend in your data. This makes it easy for you to identify when your data reaches certain values or when it deviates from the trend.  Zoho Analytics allows you to
        • Zoho Learn - AI Translate

          Hi Learn team, I had a situation today where I was providing training to a client team and I had written articles into their Zoho Learn to support their learning. I realised that one of the team members was a non-native English speaker and they were struggling
        • Payroll In Canada

          Hi, When can we expect to have payroll in Canada with books 
        • Power of Automation :: Auto-Sync Custom Date Field Between Related Tasks via Blueprint Transition

          Hello Everyone, A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate
        • Introducing auto-upgrade in Zoho LandingPage

          Hi everyone, We’re excited to share an upcoming update to help you get the most out of your landing pages — the auto-upgrade option, launching on October 22, 2025. Your landing pages are designed to bring in leads, and we want to make sure you never miss
        • Workdrive comment links stopped working.

          I have marked a PDF file with 95 comments, they have worked for a while. When i clicked on them they brought me to the correct page and showed me the outline that i had drew on the plans. The comments included the page number of the outline, but now it
        • How to Bulk-Update Sales Orders in CRM

          Hi - I need to bulk update existing sales orders with dates from our ERP of when the sales orders were created. I made a date field on the Sales Order module where I want to insert that data. I can't Mass Update because I am not updating the fields to
        • Zoho ToDo in Cliq

          Our organization utilizes Zoho ToDo in the Zoho Mail Desktop app. Is there a way for these to show up in Cliq Desktop app as well?
        • 【Zoho CRM】サンドボックス機能のアップデート:カスタムビューが利用可能になりました。

          ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 今回は「Zoho CRM アップデート情報」の中から、サンドボックス機能のアップデートをご紹介します。 目次 1. カスタムビューとは 2. 今回の機能アップデートについて 1. カスタムビューとは カスタムビューは、ユーザーが設定した条件に基づいてデータをフィルタリング・整理し、 重要な情報へ効率的にアクセスできるようにする機能です。 「過去15日間の見込み客」や「受注間近の商談」、「特定の優先度レベルが設定された案件」など 条件を指定してわずか数クリックで設定できます。
        • Next Page