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

    • Check out the new Checkbox in Zoho Sheet

      Checkbox, the simple GUI widget that lets you choose between two mutually exclusive options i.e Yes or No, is now in Zoho Sheet. Having made it across the web, Checkbox is familiar but is still elusive to most spreadsheet software. Special developer ribbons, macros and all other complexities to add a checkbox to a spreadsheet? Not in Zoho Sheet. How to add Checkbox to Zoho Sheet? Adding a Checkbox in Zoho Sheet is simple. Select a cell/range and choose "Checkbox" in "Input Controls" under the Format
    • Introducing a smarter, faster, and more flexible charting experience

      Hello Zoho Sheet users, We're delighted to share the latest news about a major update to charts in Zoho Sheet! The new version supports dynamic data ranges, granular styling options, faster loading, and other interesting enhancements that allow you to
    • What's new in Zoho Sheet: Simplify data entry and collaboration

      Hello, Zoho Sheet community! Last year, our team was focused on research and development so we could deliver updates that enhance your spreadsheet experience. This year, we’re excited to deliver those enhancements—but we'll be rolling them out incrementally
    • New Features: Repeat Last Action, Insert Cut/Copied Rows/Columns and Hyperlink

      You might have noticed the constant updates to Zoho Sheet of late. Here are 3 more features that have been added to Zoho Sheet recently: F4 - Repeat Last Action Insert Cut/Copied Rows and Columns Insert Hyperlink Here is a screen cast demonstrating each of these features. Read further below to learn more about these new features. F4 - Repeat Last Action: You can now repeat the last action you made on your spreadsheet by using the keyboard shortcut, F4. It is quite handy and helps you get your work
    • 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
    • Recent Topics

    • BANK FEED - MAYBANK , provider from YODLEE IS NOT WORKING

      As per topic, the provider YODLEE is not working for the BANK FEED. It have been reported since 2023 Q3, and second report on 2023 Q4. now almost end of 2024 Q1, and coming to 2024 Q2. Malaysia Bank Maybank is NOT working. can anyone check on this issue?
    • Digest Octobre - Un résumé de ce qui s'est passé le mois dernier sur Community

      Bonjour chers utilisateurs, Bienvenue dans ce nouveau digest de la communauté Zoho France ! Vous y trouverez les discussions marquantes, les nouveautés produits, les conseils pratiques partagés et bien sûr les événements à venir. Le mois dernier, nous
    • Bank feeds - still a problem

      I'm really frustrated that the bank feeds only "sometimes" work.  I raised this problem once before and was advised that Zoho used Yodlee and feeds were only updated once a day.  That's fine but it only "sometimes" seems to work.  Eventually transactions appear but they sometimes seem to take days.  I know of other programs (Xero) that another business I am involved with uses Yodlee and they do not have this issue. My bank feeds are active,  I tried to manually refresh however Zoho tells me that
    • this is getting ridiculous

      My checking account bank feeds haven't worked since 6/4/21.  Multiple emails to Zoho since 6/10, and all they tell me is they have re-escalated my problem to their banking service provider team.  14 days and nothing is fixed. I'm just about ready to bail
    • No feedback from Zoho Books regarding Yodlee feeds for Investec

      I reported on 6 Feb 2025 that the Bank Feeds for Investec bank via Yodlee are not working. To date there has been no resolution. You are charging us for a suite of products where the functionality does not work. Please advise how you will refund me for
    • ongoing bank sync problems

      My bank feed broke May 14th 2021 Since then I just get an endless stream of we are working on it, "Kindly bear with us for sometime" from support Multiple times I have asked to speak to managers and half the time they don't call at all. If they do call
    • We must admit - Yodlee is an unreliable partner!

      Hello Zoho, Our Yes Bank account intergration is messed up since the beginning and the problem has not been addressed yet. With bad synchronization, poor categorization of transactions, duplicate/unknown copies of accounts, no support, geared at income/expenses,
    • Make your PDFs clearer with shapes

      Sometimes the best way to mark up a PDF is to point at it directly. Zoho PDF Editor includes shape tools that let you add circle, check and cross marks anywhere in your PDF, so you can flag content for review without extra comments. Here's what you can
    • Admin Logging in as another User

      How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Latest Update (27th April 2026): With the early
    • Project Migration

      We currently have two separate Zoho organizations: A Spark Robotic organization under Zoho CRM Plus A separate Contract Manufacturing organization under Zoho One We are working with Zoho Support to consolidate the CRM Plus organization into our existing
    • CNIL - Suivi de Pixel

      Bonjour à tous, À la suite de la nouvelle recommandation de la CNIL sur les pixels de suivi dans les e-mails, savez-vous si Zoho Campaigns permet : de conditionner le suivi des ouvertures au consentement de chaque contact ; de proposer un lien permettant
    • Live connection to DS files in Zoho Creator / ChatGPT

      As an idea, we are using ChatGPT to build with Zoho Creator (outside of Zia), which is works brilliantly to assist write deluge, provide test suggesitons etc. Currently we are uploading the DS files which are very point in time, it would be great to have
    • Improved Filtering and Tagging options for Notes

      We rely on the notes section across several modules and would love to have some more options in filtering, grouping, and tagging notes. We would like to be able to filter notes differently on a contact or deal and have that choice stay on that record
    • Action required: Update the Zoho Desk Client SDK URL in your extensions

      Hi Developers, To improve reliability and performance, the Zoho Desk Client SDK is now served from a new CDN domain. We request that you update your existing extensions with the new Client SDK URL given below. Note: Going forward, all newly created extensions
    • Decoupling Email Sending from Storage in CRM & Email Storage Add-on Purchases

      Hello everyone, We are excited to announce the rollout of the second phase of our email storage management, designed around a simple principle: your business communication should never be disrupted by storage limits. We've decoupled email sending from
    • Enhancement Request: Preserve Canceled Zoho Bookings Meetings in CRM

      I recently worked with Zoho Support on ticket 170383788 regarding what happens in Zoho CRM when an appointment is canceled in Zoho Bookings. Support confirmed that the current behavior is intentional: when a Bookings appointment is canceled, the corresponding
    • Edit PDFs using Zoho PDF Editor

      Hello users, In a previous article, we covered the organizing capabilities of Zoho PDF Editor. Here, we'll provide a quick recap of its editing features, including a few new additions. A few highlights of Zoho PDF Editor's editing capabilities: Add and
    • Feature Request - Ability to Customise Contact Info Card on Ticket Details View

      Hi Desk Team, I've added a "Contact Priority" and "Account Prioirty" field and it would be very useful to agents if they could see that information in the Contact Info card on the Ticket Details view. It would be great if we could choose some fields to
    • What is a realistic turnaround time for account review for ZeptoMail?

      On signing up it said 2-3 business days. I am on business-day 6 and have had zero contact of any kind. No follow-up questions, no approval or decline. Attempts to "leave a message" or use the "Contact Us" form have just vanished without a trace. It still
    • Customer portal: recommended way to scope lookup fields to the logged-in client?

      Hi all, I'm building a customer portal on Creator for our clients (we're a esting lab, so each client has their own sites, contacts and jobs). Planning stage, so I'd rather get the approach right before I build it. The portal forms need several lookup
    • Zia for Mail: AI-powered assistance for Email, Calendar, and ToDo in Zoho Mail

      Zia for Mail brings AI assistance into Zoho Mail for everyday email, calendar, and task activities. Administrators can integrate third-party AI providers, such as ChatGPT or Gemini, and decide which features are available to users. What is Zia for Mail
    • "Else / If" Statement in Zoho CRM Inventory Template

      Hello, I would like to use the below "Else If" in my Inventory Templates, but it's not working correctly. Essentially, if the field "Quote Payment Terms" is filled in, display that. If "Quote Payment Terms" is blank, display "Account Payment Terms" instead.
    • Office Integrator

      Our users are complaining the slowness and speed when working in Zoho Office. Explicitly when working in a sheet. Here are observed issues *Copy and pasting values from one cell into another takes 10-20 seconds to show it has done it. *Modifying a value
    • [ZohoDesk] Improve Status View with a new editeble kanban view

      A kanban view with more information about the ticket and the contact who created the ticket would be valueble. I would like to edit the fields with the ones i like to see at one glance. Like in CRM where you can edit the canvas view, i would like to edit
    • Subform UI Unresponsive

      Has subform with a couple of hundreds of rows but suddenly the you can't add any row nor edit any fields. The subform has 10 columns Any thoughts on this Zoho team?
    • Kaizen #267: Four Developer Tools, One Prompt: Cracking Custom Cases with the Zoho CRM Skill

      Hello everyone! Welcome back to another Kaizen post. In this Kaizen, we’ll see how the Zoho CRM Skill solves a custom use case that requires multiple Zoho CRM developer tools. You describe the requirement in plain language, and the skill identifies the
    • Multiple locations

      I have many customers (accounts) that have multiple locations, like bank branches. How can I manage them under one account?
    • 【開催報告】 福岡 ユーザー交流会 NEXUS 2026/10/30 | CRM×AIの実践事例とZia Agents活用を紹介

      Zoho ユーザーの皆さん、こんにちは。 コミュニティグループの中野です。 10月30日(金)、福岡にてZoho ユーザー交流会 NEXUSを開催しました。 今回は、Zoho CRM × AIをテーマに、ユーザーさんによる実践事例、 Zia Agentsのデモ、参加者同士のグループワークなどを実施しました。 ご参加いただいた皆さん、ありがとうございました! 本投稿では、当日の様子を一部ご紹介します。 ユーザー活用事例 :Zoho CRM × AIを、実際の営業業務でどう使う? 登壇者:株式会社etika
    • KB Articles from Zoho Learn - Import as .md

      I love the concept of being able to use articles from Zoho Learn as knowledge base articles for Zia Agents. This will absolutely help with proper documentation and organization of company processes and SOPs. This was a great concept. However, even when
    • Service Account Admin for API Calls and System Actions

      Hello, I would like to request the addition of a Service Account Admin option in Zoho product. This feature would allow API calls and system actions to be performed on behalf of the system, rather than an active user. Current Issue: At present, API calls
    • Trigger workflows from SLA escalations in Zoho Desk?

      Hey everyone, I’m currently working with SLA escalation rules in Zoho Desk and ran into a limitation that I’m hoping someone here has solved more elegantly. As far as I can tell, SLA escalations only support fairly limited actions (like changing the ticket
    • Trident Missing

      No way you guys get so close to having trident complete for over a year then just kill it off. Wow just wow
    • Zoho One - Can I add a Custom View to All Departments

      We have been using Desk for several years but are just making the leapt to using multiple departments. I have a custom view that is our default view. I'd like to apply that to All Departments. When I try to add a view when viewing All Departments I get
    • A way to create kits (groups of items) that do not require bundling and are added to an order as the individual items

      We are evaluating moving off of Sage BusinessWorks (which handles accounting, order entry, inventory control, accounts receivable, etc) to Zoho Books/Inventory. One of the things we heavily use is a feature called Kits, which allows creating a group of
    • Issue While Rescheduling Interviews in Zoho Recruit

      Dear Zoho Support Team, We are facing an issue with the Interview Rescheduling functionality in Zoho Recruit integrated with Microsoft Teams. Problem Description When an interview is rescheduled through Zoho Recruit: The new interview is created successfully
    • Global Constants / Variables

      It would be great if there were a Global Constant feature. The idea here is for managing constants that are used in multiple Flows and Subflows, but might change over time. The idea is that the change could be made in one place and cascade to all future
    • Zoho Campaigns 3.0 is here

      Zoho CampaignsAnnouncements We're excited to introduce the all-new Zoho Campaigns, where we have introduced our biggest update yet. Marketing has evolved far beyond email. Today's campaigns span email, SMS, and WhatsApp, customers expect personalized
    • Tip #95 – Collect support requests right from your website with Web Forms – 'Insider Insights'

      Hello Zoho Assist Community! When a customer needs help, the first step often decides how smooth the rest goes. They email a vague description, a technician asks follow-up questions, and the real details only surface after several rounds of back and forth.
    • Unable to integrate Whatsapp Messaging into Zoho CRM - Business Messaging

      Hello, I want to set up Business Messaging in our Zoho CRM and am struggling to set it up. I have logged into the account and our facebook business page, our business shows in the dropdown for WhatsApp Business Account but does not for WhatsApp Business
    • E-Invoicing Automation

      Do you have an API endpoint for pushing the invoice through the e-tims for Kenya
    • Next Page