Skip to main content

VBA Code to Clear Cell Contents and Keep Formatting VBA कोड स्पष्ट सेल सामग्री और स्वरूपण साफ़ करने के लिए


# VBA Code to Clear Cell Contents and Keep Formatting:-

To clear cell contents (but not formatting) using VBA, use a statement with the following structure:
VBA का उपयोग करके सेल सामग्री (लेकिन प्रारूपण नहीं) को साफ़ करने के लिए

Cells.ClearContents


VBA Statement Explanation

  1. Item: Cells.

    • VBA Construct: Range object.
    • Description: Range object representing the cells where you want to clear the contents but not the formatting.

      You can usually return a Range object with constructs such as the Worksheet.Range, Worksheet.Cells (with Range.Item), Range.Offset, Range.Resize or Application.ActiveCell properties. If you explicitly declare an object variable to represent Cells, use the Range object data type.
  2. Item: ClearContents.
    • VBA Construct: Range.ClearContents method.
    • Description: The Range.ClearContents method clears values and formulas from the Range object you specify (Cells). Range.ClearContents leaves formatting intact.


VBA स्टेटमेंट स्पष्टीकरण

1. आइटम: सेल।

VBA निर्माण: रेंज ऑब्जेक्ट।

विवरण: रेंज ऑब्जेक्ट उन कोशिकाओं का प्रतिनिधित्व करता है जहाँ आप सामग्री को साफ़ करना चाहते हैं लेकिन प्रारूपण को नहीं।

आप आमतौर पर Worksheet.Range, Worksheet.Cells (Range.Item के साथ), Range.Offset, Range.Resize या Application.ActiveCell प्रॉपर्टी जैसे कंस्ट्रक्शन के साथ रेंज ऑब्जेक्ट वापस कर सकते हैं। यदि आप कक्ष का प्रतिनिधित्व करने के लिए स्पष्ट रूप से ऑब्जेक्ट चर घोषित करते हैं, तो रेंज ऑब्जेक्ट डेटा प्रकार का उपयोग करें।

2. आइटम: ClearContents।

VBA निर्माण: Range.ClearContents विधि।

विवरण: Range.ClearContents पद्धति आपके द्वारा निर्दिष्ट (कक्ष) श्रेणी ऑब्जेक्ट से मान और सूत्र साफ़ करती है। Range.ClearContents बरकरार स्वरूपण छोड़ देता है।

Comments

Popular posts from this blog

What is Excel ? एक्सेल क्या है ?

Excel is a spreadsheet application which have rows and columns to organize data. We can easily organize and analysis data in excel. एक्सेल एक स्प्रेडशीट एप्लिकेशन है जिसमें डेटा व्यवस्थित करने के लिए पंक्तियां और कॉलम हैं। हम एक्सेल में आसानी से डेटा व्यवस्थित और विश्लेषण कर सकते हैं।

Excel Shortcut Keys एक्सेल शॉर्टकट कुंजी

Create New Workbook नई कार्यपुस्तिका बनाएं Ctrl + N Open Workbook कार्यपुस्तिका खोलें Ctrl + O Save Workbook कार्यपुस्तिका सुरक्षित करे Ctrl + S Save As के रूप में सुरक्षित करें F12 Print File फ़ाइल छापें Ctrl + P Open Print Preview Window प्रिंट पूर्व विंडो खोलना Ctrl + F2 Close Current Workbook वर्तमान कार्यपुस्तिका बंद करें Ctrl + F4 Close Excel एक्सेल बंद करें Alt + F4

VBA Coding : For Sharing data by Email With Attachment using Excel data in other Place

' We have some data in Excel that we want to share by email with attachment हमारे पास Excel में कुछ डेटा हैं जिन्हें हम अनुलग्नक के साथ ईमेल द्वारा साझा करना चाहते हैं Sub For_GSTR3B_Report_Share() Dim sWorkbook1 As Workbook Dim wb As Workbook Dim objApp As Object  'For New Workbook Dim ws As Worksheet Dim savepath As String         'Delete all file from folder temp2         On Error Resume Next         Kill "C:\Users\PRAMOD.GARG\Desktop\pk_temp*.*"         On Error GoTo 0               On Error Resume Next         Set wb = Workbooks("Pkgarg_Control_Sheet_With_Gaurav_Coding.xlsm")         On Error GoTo 0         If Not wb Is Nothing Then         MsgBox "It's open"         wb.Activate         Worksheets("For_GSTR3B_Report_Share...