• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Excel VBA Macro Code Query |VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Excel VBA Macro Code Query |VBA & Macros|Excel Forum|My Online Training Hub

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosExcel VBA Macro Code Query
sp_PrintTopic sp_TopicIcon
Excel VBA Macro Code Query
Avatar
sharad chavan

New Member
Members
Level 0
Forum Posts: 1
Member Since:
January 14, 2023
sp_UserOfflineSmall Offline
1
January 14, 2023 - 4:07 pm
sp_Permalink sp_Print

I have a query for Excel VBA actually.

I have a dropdown list in cell A2 of excel sheet like selecting, A, B, C and D, and also have cells E to H in Excel Worksheet, I want logic to work automatically wherein, when user selects anything from A, B, C only. Values in Cells E to H should get cleared off automatically.

I have used VBA code at worksheet level like Worksheet Activate or Selection Change event to do this. But it is creating issues like Continuous screen flickering of that particular worksheet.

Regards,
CHEMCIAl

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1800
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
January 17, 2023 - 2:59 pm
sp_Permalink sp_Print

Hi Sharad,
You should use the Workbook_Change event, with a condition to monitor columns A,B,C, but make sure you disable events, otherwise clearing cells is also triggering the change event:

If Target.Column<4 then
Application.Enableevents=false
Range("E" & Target.Row & ":H" & Target.Row).ClearContents
Application.Enableevents=True
End If

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 170
Currently Online: Brenda Krol
Guest(s) 46
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1431
Anders Sehlstedt: 848
Velouria: 574
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 213
A.Maurizio: 202
Aye Mu: 201
Jessica Stewart: 185
Newest Members:
David Collins
Andras Marsi
Orimoloye Funsho
YUSUF IMAM KAGARA
PRADEEP PRADHAN
Vicky Otosnika
Abhishek Singh
Kevin Sojourner
Kara Weiss
And Woox
Forum Stats:
Groups: 3
Forums: 24
Topics: 6047
Posts: 26544

 

Member Stats:
Guest Posters: 49
Members: 31497
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Riny van Eekelen
© Simple:Press —sp_Information
  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
 
  • About My Online Training Hub
  • Contact
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Copyright © 2023 · My Online Training Hub · All Rights Reserved

Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x