Monday, 5 December 2022

Why Excel Macros Important to learn? | Macro सिखना क्यू जरुरी हैं | VBA | Excel Samadhaan

VBA Macros समय की बचत करते हैं, क्योंकि वे दोहराए जाने वाले कार्यों को स्वचालित करते हैं। यह visual basic for applications प्रोग्रामिंग कोड का एक टुकड़ा है जो एक्सेल वातावरण में चलता है, और मैक्रोज़ प्रोग्राम करने के लिए या कोड का आनंद लेने के लिये आपको कोडर ही होने की आवश्यकता नहीं है | लेकिन, मैक्रो में अपने हिसाब से changes करने के लिए आपको VBA की बेसिक knowledge होना बहुत जरुरी है।

यदि आप उत्सुक हैं कि मैक्रोज़ क्या हैं या वास्तव में उन्हें कैसे बनाया जाए, तो कोई बात नहीं - हम आपको पूरी प्रक्रिया के बारे में बताएंगे।

एक्सेल में कुछ काम होते हैं जो हम रोजाणा करते हैं। क्या यह बेहतर नहीं होगा कि एक बटन दबाने का कोई जादुई तरीका हो और हमारे रिपोर्ट के सभी नियमित कार्य चुटकियो मे हो जाएं? 
मैं आपको हाँ कहते हुए सुन रहा हूँ। 

एक्सेल में मैक्रो आपके इसी काम को हासिल करने में हमारी मदद करता है। एक नॉर्मल MIS की भाषा में कहू तो, एक्सेल में मॅक्रो आपके नियमित काम को रिकॉर्डिंग के रूप में लिख लेता है जिसे आप एक बटन का उपयोग करके फिर से चला सकते हैं।

Example के तौर पर कहू तो, आप आपके किसीं डेटा को एक्सेल में इम्पोर्ट करते हैं और उसे अपने रिपोर्ट के जरूरतो के अनुसार फॉरमॅट करते हैं। अगले दिन आपको वही सेम काम करने की आवश्यकता होगी। रोज रोज सेम काम, यह जल्द ही बोअरिंग और थकाऊ हो जाएगा। मैक्रोज़ ऐसे नियमित कार्यों को स्वचालित करके ऐसी समस्याओं का समाधान करते हैं। आप के इसी काम को रिकॉर्ड करने के लिए आप मैक्रो का उपयोग कर सकते हैं| जैसे की, डेटा इम्पोर्ट करना और अपनी रिपोर्टिंग की आवश्यकताओं को पूरा करने के लिए इसे formating करना|

 एक्सेल में मॅक्रोस एक ऐसा benefit हैं जो स्वचालित रूप से आपके लिए कोड को उत्पन्न करती हैं, आपके हर स्टेप्स को रेकॉर्ड कर कर के, Source कोड दे देती है! 

हम छोटे छोटे स्टेप्स से लेकर कॉम्प्लेक्स रिपोर्टिंग प्रक्रियाओं तक कई फाइलों के साथ सब कुछ Automated करने के लिए VBA मैक्रोज़ का उपयोग कर सकते हैं| 


Highlight Cells with Misspelled Words

Excel doesn’t have a spell check as it has in Word or PowerPoint. While you can run the spell check by hitting the F7 key, there is no visual cue when there is a spelling mistake.

Use this code to instantly highlight all the cells that have a spelling mistake in it.

'This code will highlight the cells that have misspelled words
Sub HighlightMisspelledCells()
Dim cl As Range
For Each cl In ActiveSheet.UsedRange
If Not Application.CheckSpelling(word:=cl.Text) Then
cl.Interior.Color = vbRed
End If
Next cl
End Sub

Note: that the cells that are highlighted are those that have text that Excel considers as a spelling error. In many cases, it would also highlight names or brand terms that it doesn’t understand.




How to Get Only the Numeric Part from a String in Excel

If you want to extract only the numeric part or only the text part from a string, you can create a custom function in VBA.

You can then use this VBA function in the worksheet (just like regular Excel functions) and it will extract only the numeric or text part from the string.

Something as shown below:

Dataset to get the numeric or the text part in Excel

Below is the VBA code that will create a function to extract numeric part from a string:

'This VBA code will create a function to get the numeric part from a string
Function GetNumeric(CellRef As String)
Dim StringLength As Integer
StringLength = Len(CellRef)
For i = 1 To StringLength
If IsNumeric(Mid(CellRef, i, 1)) Then Result = Result & Mid(CellRef, i, 1)
Next i
GetNumeric = Result
End Function

You need place in code in a module, and then you can use the function =GetNumeric in the worksheet.

This function will take only one argument, which is the cell reference of the cell from which you want to get the numeric part.



Similarly, below is the function that will get you only the text part from a string in Excel:

'This VBA code will create a function to get the text part from a string
Function GetText(CellRef As String)
Dim StringLength As Integer
StringLength = Len(CellRef)
For i = 1 To StringLength
If Not (IsNumeric(Mid(CellRef, i, 1))) Then Result = Result & Mid(CellRef, i, 1)
Next i
GetText = Result
End Function

So these are some of the useful Excel macro codes that you can use in your day-to-day work to automate tasks and be a lot more productive.



यदि आप एक्सेल मैक्रोज़ को सेव्ह करना चाहते हैं, तो आपको अपनी वर्कबुक को Macro-Enable टाईप में सेव करना होगा (.xlsm)

No comments:

Post a Comment

featured Post

Recurring Deposite

  https://tax2win.in/guide/5-year-post-office-recurring-deposit

About Me

My photo
Kalyan, Mumbai, Maharashtra, India

Quick Search Formula