Dear Excel Gurus,
I have a peculiar problem. When I import data in excel from Tally it shows me number as shown below Balance Debit Credit Balance Aditya Birla Memorial Hospital 3049.00 3049.00 Aditya Enterprises 99521.00 101086.00 1565.00 Cr Airways Corporation 39363.80 Dr 39363.80 Dr Airways Surgical Pvt Ltd 361446.45 Dr 959168.00 1133676.00 186938.45 Dr AL-SAMIYAH GROUP FOR MARKETING & INT. TRADE 791326.00 883606.25 92280.25 Cr Al-Wafigroup for Marketing & Int'l Trade Co. 743036.00 754572.48 11536.48 Cr When I check in format menu it shows me ""0.00" Cr" for NEGETAIVE value and ""0.00" Dr" for POSITIVE value. All I want to do is recognise the format with the help of macro and change the value accordingly. I have tried to develop a macro with my very lesser knowledge but it is not working as value of variable "b" is not changing according to its present (changing) location. Please help. My VBA Working Sub format() a = Range("e15").NumberFormat ' i want this "b" shall change value according to the new destination i.e. ' _want to make it as variable according to the new cell format. b = ActiveCell.NumberFormat Do ActiveCell.Offset(1, 0).Select If a = b Then ActiveCell.Offset(0, 1).Select ActiveCell.Formula = ActiveCell.Offset(0, -1) * -1 ActiveCell.Offset(0, -1).Select Else ActiveCell.Offset(0, 1).Select ActiveCell.Formula = ActiveCell.Offset(0, -1) * 1 ActiveCell.Offset(0, -1).Select End If Loop Until ActiveCell.Offset(0, -4).Value = "" End Sub Thanks in advance. Thank you Regards Sandeep Kumar Chhajer. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/groups/opt_out.
dr cr.xlsb
Description: application/vnd.ms-excel.sheet.binary.macroenabled.12