Excel Macro to find perticular column name
Closed
Saurabh
-
Mar 3, 2011 at 08:36 PM
soniamike732 Posts 1 Registration date Tuesday March 8, 2011 Status Member Last seen March 8, 2011 - Mar 8, 2011 at 10:10 AM
soniamike732 Posts 1 Registration date Tuesday March 8, 2011 Status Member Last seen March 8, 2011 - Mar 8, 2011 at 10:10 AM
Related:
- Excel Macro to find perticular column name
- Spell number in excel without macro - Guide
- How to change author name in excel - Guide
- Excel marksheet - Guide
- Excel free download - Download - Spreadsheets
- How to take screenshot in excel - Guide
3 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 4, 2011 at 04:49 AM
Mar 4, 2011 at 04:49 AM
before tampering with data save the file somewhere else safely for retrieval if necessary
try this macro
try this macro
Sub test() Dim j As Integer, cfind As Range Set cfind = ActiveSheet.UsedRange.Cells.Find(what:="ID", lookat:=xlWhole) j = cfind.Column Columns(j).NumberFormat = "000-000-000" Set cfind = ActiveSheet.UsedRange.Cells.Find(what:="AMT", lookat:=xlWhole) j = cfind.Column Columns(j).NumberFormat = "000,000,00#.00" End Sub
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 8, 2011 at 01:51 AM
Mar 8, 2011 at 01:51 AM
try in what:= like this
what:="*id*
and see whether you succeed.
star sign before and after is widcard with "ID" in between.
wild cards some tiems succeed and some time fail
what:="*id*
and see whether you succeed.
star sign before and after is widcard with "ID" in between.
wild cards some tiems succeed and some time fail
soniamike732
Posts
1
Registration date
Tuesday March 8, 2011
Status
Member
Last seen
March 8, 2011
Mar 8, 2011 at 10:10 AM
Mar 8, 2011 at 10:10 AM
Weldon job dear.
http://www.maxglim.com
http://www.maxglim.com
Mar 7, 2011 at 10:23 PM
Yaa this code is working fine. Thanks a lot for this.
But in my case -
1) Column is not always ID, it can be ID1,ID_1,1_ID.
So I want to search columns with key like 'ID' and then format
2) Also ID column will always have alphanumeric values like 123CD6789 and I want it as 123-CD6-789.NumberFormat doesn't work for alphanumeric.
Can you please help?
Mar 8, 2011 at 09:36 AM
ID_1 AMT_1 ID1 AMT1 AMT2 1_ID 1_AMT
1A3456789 1 2B3456789 12.23 0 3B3456789 98765
Output after macro execution should be-
1A3-456-789 $1.00 2B3-456-789 $12.23 $0.00 3B3-456-789 $98,765.00