SOLVED

Column width

%3CLINGO-SUB%20id%3D%22lingo-sub-1578186%22%20slang%3D%22en-US%22%3EColumn%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578186%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20know%20if%20I%20can%20use%20a%20formula%20to%20set%20a%20column%20width%20that%20depends%20on%20the%20width%20of%20the%20row%20number.%20For%20example%3A%20If%20the%20row%20number%20exceeds%20999%2C%20then%20the%20row%20number%20column%20width%20increases%20in%20order%20to%20accommodate%20the%20fourth%20digit.%20I%20need%20column%20A%20to%20%3CU%3Ereduce%3C%2FU%3E%20in%20size%20when%20that%20occurs%2C%20so%20that%20the%20displayed%20data%20does%20not%20shift%20to%20the%20right.%20Is%20it%20possible%20to%20control%20this%3F%20If%20so%2C%20how%3F%20I%20am%20guessing%20that%20the%20formula%20%22If%20Row%20Number%20%26gt%3B%20999%20then%20Column%201%20width%20%3D%20%3F%22%20would%20do%20it%2C%20but%20is%20is%20possible%2C%20please%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20grateful%20for%20suggestions%2C%20please.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETom%20W%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1578186%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578210%22%20slang%3D%22de-DE%22%3ESubject%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578210%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EMany%20roads%20lead%20to%20Rome%20...%20with%20Excel%20there%20are%20many%20more%20roads%20to%20a%20solution.%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%20%3CSPAN%3EWith%20a%20simple%20formula%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3DCELL(%22width%22%2CD1)%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3EWith%20VBA%3A%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%3ESub%20%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EColumn_width%3C%2FSPAN%3E%3C%2FSPAN%3E()%20%20%0A%20Sheets(%22Tabelle1%22).Activate%20%20%0A%20Range(%22S%3ANH%22).EntireColumn.ColumnWidth%20%3D%2015%20%20%0AEnd%20Sub%3C%2FPRE%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20community%20members%20reading%20here.%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E*%20Beware%20of%20scammers%20posting%20fake%20support%20numbers%20here.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578219%22%20slang%3D%22de-DE%22%3ESubject%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578219%22%20slang%3D%22de-DE%22%3EIf%20it%20had%20to%20automatically%20adapt%20its%20content.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%20Sub%20Column_width()%20%3CBR%20%2F%3E%20Sheets(%22Table1%22).%20Activate%20%3CBR%20%2F%3E%20Columns(%22C%3AD%22).%20EntireColumn.AutoFit%20%3CBR%20%2F%3E%20End%20Sub%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578234%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578234%22%20slang%3D%22en-US%22%3E%3CP%3EI%20too%20am%20like%20Socrates!%3C%2FP%3E%3CP%3ENot%20sure%20what%20you%20mean...%20I%20want%20the%20column%20width%20of%20Column%20A%20to%20reduce%20by%20the%20increased%20width%20of%20the%20Numbered%20Row%20Column%20when%20the%20Row%20number%20increases%20from%20999%2010%201000.%3C%2FP%3E%3CP%3ESorry%2C%20if%20I%20am%20not%20being%20clear.%3C%2FP%3E%3CP%3ETom%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E-ERR%3AREF-NOT-FOUND-%40Nikolino%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578241%22%20slang%3D%22de-DE%22%3ERE%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578241%22%20slang%3D%22de-DE%22%3EAnother%20way%20Then%20just%20take%20over%20the%20widths%20from%20the%20given%20columns.%20Private%20Sub%20Worksheet_Activate()%20Sheets(%22Table2%22).%20Columns(%22A%22).%20ColumnWidth%20%3D%20Sheets(%22Table1%22).%20Range(%22A1%22)%20Sheets(%22Table2%22).%20Columns(%22B%22).%20ColumnWidth%20%3D%20Sheets(%22Table1%22).%20Range(%22B1%22)%20End%20Sub%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578251%22%20slang%3D%22en-US%22%3ERE%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578251%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20so%20much%20for%20your%20help%2C%20but%20something%20may%20be%20being%20lost%20intranslation%20from%20english%20to%20german%20and%20vice%20versa.%20I%20nedd%20to%20adjust%20the%20width%20of%20Column%20A%20dependent%20on%20the%20width%20of%20the%20Row%20Number%20column.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F722750%22%20target%3D%22_blank%22%3E%40Nikolino%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578260%22%20slang%3D%22de-DE%22%3ESubject%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578260%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehere%20a%20examble%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3Ecolumn%3C%2FSPAN%3E%3C%2FSPAN%3E%20B%2C%20%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%20%3CSPAN%20class%3D%22%22%3EWrite%20whatever%20you%20want%20the%20column%20will%20automatically%20change.%3C%2FSPAN%3E%3CBR%20%2F%3E%20%3CSPAN%3EI%20hope%20that%20I%20could%20help%20you%20with%20this.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%20%3CBR%20%2F%3E%20I%20know%20I%20know%20nothing%20(Socrates)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578316%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578316%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F722750%22%20target%3D%22_blank%22%3E%40Nikolino%3C%2FA%3E%2C%20I%20think%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%20is%20not%20aware%20of%20using%20macro%20subs%20and%20needs%20guidance%20on%20how%20to%20put%20your%20VBA%20code(s)%20in%20any%20of%20his%20workbook..%20could%20you%20pls.%20guide%20him%20on%20that%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1578357%22%20slang%3D%22de-DE%22%3ESubject%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1578357%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EOpen%20an%20existing%20workbook%20or%20create%20a%20new%2C%20empty%20one.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EThe%20fastest%20way%20to%20get%20to%20the%20Microsoft%20Visual%20Basic%20Editor%20is%20via%20the%20shortcut%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EPress%20the%20key%20combination%20ALT%20F11.%3C%2FSPAN%3E%3CBR%20%2F%3E%20%3CSPAN%20class%3D%22%22%3EExcel%20now%20shows%20the%20VBA%20editor%20or%20macro%20editor.%3C%2FSPAN%3E%3CBR%20%2F%3E%20%3CSPAN%20class%3D%22%22%3ESelect%20the%20MODULE%20command%20from%20the%20INSERT%20menu.%3C%2FSPAN%3E%3CBR%20%2F%3E%20%3CSPAN%20class%3D%22%22%3EExcel%20displays%20a%20window%20in%20which%20you%20can%20type%20or%20copy%20the%20program%20code.%3C%2FSPAN%3E%3CBR%20%2F%3E%20%3CSPAN%20class%3D%22%22%3EWhen%20you%20are%20ready.%3C%2FSPAN%3E%20%3CSPAN%3EClose%20the%20VBA%20editor%20with%20the%20command%20FILE%20-%20CLOSE%20AND%20RETURN%20TO%20MICROSOFT%20EXCEL%20or%20the%20key%20combination%20ALT%20Q.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%3ESome%20more%20infos%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fde-de%2Fhelp%2F219905%2Fhow-to-dynamically-add-and-run-a-vba-macro-from-visual-basic%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fde-de%2Fhelp%2F219905%2Fhow-to-dynamically-add-and-run-a-vba-macro-from-visual-basic%3C%2FA%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%3EThx%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%3ENikolino%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1600869%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1600869%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F722750%22%20target%3D%22_blank%22%3E%40Nikolino%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%20Nicolino.%20Are%20you%20able%20to%20tell%20me%20the%20code%20that%20will%20keep%20the%20row-number%20column%20at%20a%20fixed%20(wider%20than%20the%20default)%20width%2C%20please%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETom%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1601003%22%20slang%3D%22de-DE%22%3ESubject%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1601003%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20I%20sent%20you%20if%20you%20want%20fixed%20column%20width%2C%20you%20should%20enroll%20the%20first%20VBA%20code%20in%20your%20macro%2C%20changing%20the%20width%20depending%20on%20the%20area.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3ESub%20%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EColumn_width%3C%2FSPAN%3E%3C%2FSPAN%3E()%20%20%0A%20Sheets(%22Tabelle1%22).Activate%20%20%0A%20Range(%22A1%3AA999%22).EntireColumn.ColumnWidth%20%3D%2015%3CBR%20%2F%3E%20Range(%22A1000%3AA4500%22).EntireColumn.ColumnWidth%20%3D%2025%20%20%20%0AEnd%20Sub%3C%2FPRE%3E%3CP%3E%26nbsp%3BAlso%2C%20don't%20know%20how%20I%20can%20help%20you%2C%20a%20file%20(without%20sensitive%20data)%20would%20be%20beneficial.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605263%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605263%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%2C%20also%20if%20you%20want%20that%20in%20all%20of%20your%20workbooks%2C%20the%20column%20width%20remains%20a%20fixed%20default%2C%20then%20MS%20suggests%20setting%20up%20a%20template.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20this%20link%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fcustomize-how-excel-starts-6509b9af-2cc8-4fb6-9ef5-cf5f1d292c19%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fcustomize-how-excel-starts-6509b9af-2cc8-4fb6-9ef5-cf5f1d292c19%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Escroll%20down%20to%20this%20topic%20%3A-%3C%2FP%3E%3CH2%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245565%22%20id%3D%22toc-hId--1295245590%22%3EAutomatically%20open%20a%20workbook%20template%20or%20worksheet%20template%20when%20you%20create%20a%20new%20workbook%20or%20worksheet%3C%2FH2%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605625%22%20slang%3D%22en-US%22%3ERE%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605625%22%20slang%3D%22en-US%22%3EI%20have%20a%20checkbook%20register%20in%20Excel.%20What%20I%20would%20like%20to%20do%20is%20to%20format%20the%20date%20column%2C%20so%20when%20I%20enter%20a%20date%20it%20will%20appear%20in%20the%20correct%20order.%20For%20example%2C%207%2F10%2F20%20will%20appear%20after%207%2F5%2F20%20but%20before%208%2F10%2F20.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605683%22%20slang%3D%22en-US%22%3ERE%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605683%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767792%22%20target%3D%22_blank%22%3E%40silverfox251%3C%2FA%3E%26nbsp%3B%2C%20hi%2C%20yours%20is%20a%20new%20problem%2C%20so%20it%20is%20suggested%20to%20start%20a%20new%20discussion%20thread%20for%20the%20same.%3C%2FP%3E%3CP%3EGo%20to%20%3CEM%3EStart%20a%20New%20Conversation%3C%2FEM%3E%20as%20shown%20in%20image%20below.%20Also%20it%20is%20suggested%20to%20attach%20your%20example%20excel%20file%20when%20you%20post%20the%20problem.%20BTW%2C%20it%20looks%20like%20you%20just%20have%20to%20sort%20the%20register%20table%20by%20date%2C%20still%20people%20here%20would%20be%20better%20able%20to%20understand%20your%20issue%20if%20you%20attach%20your%20file%20(delete%20any%20confidential%20info%20of%20yours%20before%20uploading%20here)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22amit_bhola_0-1598114950054.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F213978iF6AE92CE5EDAAFE9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22amit_bhola_0-1598114950054.png%22%20alt%3D%22amit_bhola_0-1598114950054.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605693%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605693%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F636579%22%20target%3D%22_blank%22%3E%40amit_bhola%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20Amit.%3C%2FP%3E%3CP%3EI%20know%20how%20to%20adjust%20all%20the%20lettered%20columns%2C%20it%C2%B4s%20the%20column%20that%20holds%20the%20built%20in%20row-numbering%20that%20I%20want%20to%20control%20i.e.%20the%20left%20of%20column%20A.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETom%20W%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605695%22%20slang%3D%22en-US%22%3ERE%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605695%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767792%22%20target%3D%22_blank%22%3E%40silverfox251%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eas%20per%20Amit%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1605709%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1605709%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%2C%20i%20don't%20think%20that%20is%20possible%20to%20control%20in%20Excel.%3C%2FP%3E%3CP%3EIf%20you%20want%2C%20you%20may%20like%20to%26nbsp%3B%3CSPAN%3Epose%20this%20problem%20as%20a%20new%20thread%20again%20so%20that%20it%20gets%20fresh%20attention%20of%20other%20experts%20here.%20Take%20care%20to%20use%20a%20more%20descriptive%20heading%20and%20describe%20your%20problem%20with%20help%20of%20an%20image%20like%20below%2C%20because%20frankly%2C%20it%20is%20a%20unique%20request%20and%20difficult%20to%20understand%20with%20only%20words.%20The%20non-helpful%20replies%20to%20you%20till%20now%20are%20signalling%20this%20too.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22amit_bhola_1-1598116110794.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F213980iAC54D37410EBF5EF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22amit_bhola_1-1598116110794.png%22%20alt%3D%22amit_bhola_1-1598116110794.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1606486%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1606486%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F388625%22%20target%3D%22_blank%22%3E%40tomc72%3C%2FA%3E%26nbsp%3B%2C%20as%20workaround%2C%20you%20can%20hide%20the%20headings%20by%20going%20to%20VIEW%20tab%20and%20unchecking%20the%20Headings%20under%20%22Show%22%26nbsp%3B%20as%20shown%20in%20below%20image.%26nbsp%3B%20Then%20on%20scrolling%20down%2C%20the%20columns%20won't%20shift%20to%20the%20right.%20But%20compromise%20is%2C%20you%20cannot%20see%20row%20numbers%20(1%2C2%2C3...)or%20column%20headers%20(A%2CB%2CC...).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22amit_bhola_0-1598180497864.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F214148iABB84BB7857E0DE3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22amit_bhola_0-1598180497864.png%22%20alt%3D%22amit_bhola_0-1598180497864.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1609979%22%20slang%3D%22en-US%22%3EBetreff%3A%20Column%20width%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1609979%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F636579%22%20target%3D%22_blank%22%3E%40amit_bhola%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20Amit...%20that%C2%B4ll%20do%20nicely%20for%20me!%20Perfectly%20proves%20the%20KISS%20principal%2C%20eh!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETom%20W%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I would like to know if I can use a formula to set a column width that depends on the width of the row number. For example: If the row number exceeds 999, then the row number column width increases in order to accommodate the fourth digit. I need column A to reduce in size when that occurs, so that the displayed data does not shift to the right. Is it possible to control this? If so, how? I am guessing that the formula "If Row Number > 999 then Column 1 width = ?" would do it, but is is possible, please?

 

I would be grateful for suggestions, please.

 

Tom W

18 Replies

@tomc72 

Many roads lead to Rome ... with Excel there are many more roads to a solution.

With a simple formula:

=CELL("width",D1)

 

With VBA:

Sub Column_width()	 
 Sheets("Tabelle1").Activate	 
 Range("S:NH").EntireColumn.ColumnWidth = 15	 
End Sub

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

* Beware of scammers posting fake support numbers here.

If it had to automatically adapt its content.

Sub Column_width()
Sheets("Tabelle1").Activate
Columns("C:D").EntireColumn.AutoFit
End Sub

I too am like Socrates!

Not sure what you mean... I want the column width of Column A to reduce by the increased width of the Numbered Row Column when the Row number increases from 999 10 1000.

Sorry, if I am not being clear.

Tom

 

 

 

 

 

@Nikolino 

another way Then just take over the widths from the given columns. Private Sub Worksheet_Activate() Sheets("Tabelle2").Columns("A").ColumnWidth = Sheets("Tabelle1").Range("A1") Sheets("Tabelle2").Columns("B").ColumnWidth = Sheets("Tabelle1").Range("B1") End Sub

Thank you so much for your help, but something may be being lost intranslation from english to german and vice versa. I nedd to adjust the width of Column A dependent on the width of the Row Number column.

@Nikolino 

@tomc72 

 

here a examble

column B, Write whatever you want the column will change automatically.
I hope that I could help you with this.

 

Nikolino
Ich weiss dass ich nichts weiss (Sokrates)

@Nikolino, I think @tomc72 is not aware of using macro subs and needs guidance on how to put your VBA code(s) in any of his workbook.. could you pls. guide him on that?

@tomc72 

Open an existing workbook or create a new, empty one.

The fastest way to get to the Microsoft Visual Basic Editor is via the shortcut

Press the key combination ALT F11.
Excel now shows the VBA editor or macro editor.
Select the MODULE command from the INSERT menu.
Excel displays a window in which you can type or copy the program code.
When you are ready. Close the VBA editor with the command FILE - CLOSE AND RETURN TO MICROSOFT EXCEL or the key combination ALT Q.

 

Some more infos:

https://support.microsoft.com/de-de/help/219905/how-to-dynamically-add-and-run-a-vba-macro-from-visu...

 

Thx

Nikolino

@Nikolino 

Many thanks Nicolino. Are you able to tell me the code that will keep the row-number column at a fixed (wider than the default) width, please?

 

Tom

@tomc72 

Wie ich Ihnen schon gesendet habe, wenn sie feste Spaltenbreite möchten, sollten Sie den ersten VBA Code in Ihr Makro einschreiben, wobei Sie die breite je nach bereich ändern.

 

Sub Column_width()	 
 Sheets("Tabelle1").Activate	 
 Range("A1:A999").EntireColumn.ColumnWidth = 15
Range("A1000:A4500").EntireColumn.ColumnWidth = 25 End Sub

 Weis auch nicht wie ich Ihnen weiterhelfen kann, eine Datei (ohne sensible daten) wäre von vorteil.

 

Danke,

Nikolino

 

@tomc72 , also if you want that in all of your workbooks, the column width remains a fixed default value of your choice, then MS suggests setting up a template.

 

On this link

 

https://support.microsoft.com/en-us/office/customize-how-excel-starts-6509b9af-2cc8-4fb6-9ef5-cf5f1d...

 

scroll down to this topic :-

Automatically open a workbook template or worksheet template when you create a new workbook or worksheet

I have a checkbook register in Excel. What I would like to do is to format the date column, so when I enter a date it will appear in the correct order. For example, 7/10/20 will appear after 7/5/20 but before 8/10/20.

@silverfox251 , hi, yours is a new problem, so it is suggested to start a new discussion thread for the same.

Go to Start a New Conversation as shown in image below. Also it is suggested to attach your example excel file when you post the problem. BTW, it looks like you just have to sort the register table by date, still people here would be better able to understand your issue if you attach your file (delete any confidential info of yours before uploading here)

 

amit_bhola_0-1598114950054.png

 

@amit_bhola 

Thanks Amit.

I know how to adjust all the lettered columns, it´s the column that holds the built in row-numbering that I want to control i.e. the left of column A.

 

Tom W

@silverfox251 

as per Amit

Thank you

@tomc72 , i don't think that is possible to control in Excel.

If you want, you may like to pose this problem as a new thread again so that it gets fresh attention of other experts here. Take care to use a more descriptive heading and describe your problem with help of an image like below, because frankly, it is a unique request and difficult to understand with only words. The non-helpful replies to you till now are signalling this too.

 

amit_bhola_1-1598116110794.png

 

 

best response confirmed by tomc72 (Contributor)
Solution

@tomc72 , as workaround, you can hide the headings by going to VIEW tab and unchecking the Headings under "Show"  as shown in below image.  Then on scrolling down, the columns won't shift to the right. But compromise is, you cannot see row numbers (1,2,3...)or column headers (A,B,C...).

 

amit_bhola_0-1598180497864.png

 

@amit_bhola 

 

Thanks Amit... that´ll do nicely for me! Perfectly proves the KISS principal, eh!

 

Tom W