SOLVED

Formula

%3CLINGO-SUB%20id%3D%22lingo-sub-867695%22%20slang%3D%22en-US%22%3EFormula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-867695%22%20slang%3D%22en-US%22%3EI%20am%20needing%20a%20formula%20that%20will%20check%20cell%20a3%20if%20has%20data%20go%20down%20to%20next%20cell%2C%20then%20copy%20the%20data%20from%20another%20worksheet%20called%20invoice%20and%20the%20cell%20is%20a13.%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-867695%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868526%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868526%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%20place%20this%20formula%20in%20A4%3C%2FP%3E%3CP%3E%3DIF(A3%3D%22%22%2C%22%22%2CInvoice!A13)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868735%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868735%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20again%3C%2FP%3E%3CP%3EIn%20my%20answer%20I%20focused%20on%20%22%3CSTRONG%3ESELECTING%3C%2FSTRONG%3E%22%20the%20cell%20below%20assuming%20that%20you%20want%20this%20cell%20to%20be%26nbsp%3B%3CSTRONG%3Eselected%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3EHowever%20if%20%22%3CSTRONG%3ESelecting%20A4%3C%2FSTRONG%3E%22%20is%20not%20a%20must%20then%2C%20without%20a%20doubt%20go%20with%20the%20nice%20formula%20provided%20by%20our%20team%20mate%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3CP%3ENabil%20Mourad%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868523%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868523%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20not%20think%20this%20can%20be%20done%20with%20a%20formula%2C%20because%20a%20conditional%20formula%20returns%20a%20value%20but%20%3CSTRONG%3Enot%20a%20selection.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EHowever%20it%20could%20be%20done%20by%20a%20code%20in%20VBA.%20Also%20you%20need%20to%20decide%20how%20would%20you%20like%20to%20run%20that%20code%3A%20Is%20it%20manually%3F%20or%20with%20the%20opening%20event%20of%20the%20workbook%20or%20with%20the%20change%20happening%20to%20a%20cell%20you%20specify%3F%3C%2FP%3E%3CP%3EI%20need%20more%20details%20or%20better%20a%20sample%20file%20to%20do%20it%20properly.%3C%2FP%3E%3CP%3EThe%20concept%20is%20as%20follows%3C%2FP%3E%3CP%3EALT%20%2B%20F11%20%26gt%3B%26gt%3B%20opens%20the%20VB%20editor%3C%2FP%3E%3CP%3EALT%20%2B%20I%20%2B%20M%20%26gt%3B%26gt%3B%20creates%20a%20module%3C%2FP%3E%3CP%3Ethen%20type%3A%3C%2FP%3E%3CP%3ESub%20Evaluate()%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BIf%20Range(%22A3%22).%20value%20%26lt%3B%26gt%3B%20%22%22%20Then%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Range(%22A4%22).%20select%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20ActiveCell.value%3D%20Sheets(%22Invoice%22).Range(%22A13%22).value%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BEnd%20If%3C%2FP%3E%3CP%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helps%3C%2FP%3E%3CP%3ENabil%20Mourad%3C%2FP%3E%3CP%3E%26nbsp%3B%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-868766%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868766%22%20slang%3D%22en-US%22%3EI%20need%20the%20code%20to%20run%20when%20the%20data%20changes%20in%20the%20invoice%20sheet%20a13%20so%20to%20copy%20the%20info%20to%20a%20tracking%20sheet.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868769%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868769%22%20slang%3D%22en-US%22%3EAlso%20reasoning%20for%20checking%20cell%20a3%20was%20so%20not%20to%20over%20write%20the%20data.%20I%20need%20the%20code%20to%20check%20the%20last%20cell%20in%20the%20column%20with%20data%20then%20move%20down%20to%20next%20vacant%20cell%20and%20Copy%20data%20from%20invoice%20sheet%20a13%20into%20the%20black%20cell.%20Sorry%20for%20the%20confusion.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868784%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868784%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%3C%2FP%3E%3CP%3ETo%20run%20the%20code%20whenever%20A13%20changes%20in%20the%20Invoice%20worksheet%2C%20then%3C%2FP%3E%3CP%3EYou%20need%20to%20attach%20the%20code%20to%20cell%20A13%20Change%20event%3A%3C%2FP%3E%3CP%3ETo%20do%20that%2C%3C%2FP%3E%3CP%3ERight%20click%20the%20worksheet%20Tab%20(Invoice)%20%26gt%3B%26gt%3B%20select%20view%20code%3C%2FP%3E%3CP%3EIn%20the%20VB%20Editor%2C%20you%20have%202%20drop%20lists%2C%20from%20the%20left%20one%20select%20%22Worksheet%22%20from%20the%20Right%20one%20select%20%22Change%22%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F132903iCFE8B5A0AE978D45%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Loop.png%22%20title%3D%22Loop.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3EThen%20write%20the%20code%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3CBR%20%2F%3EIf%20Target.Address%20%3D%20Range(%22A13%22).Address%20Then%3CBR%20%2F%3ECall%20Evaluate%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20want%20to%20check%20if%20a%20cell%20is%20empty%20then%20proceed%20to%20the%20cell%20below%20without%20overwriting%2C%20that%20requires%20modifying%20the%20Evaluate%20code%20and%20let%20it%20loop%20before%20copying.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868828%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868828%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBased%20on%20your%20description%2C%20assuming%20you%20have%20two%20sheets%20called%20%22Tracking%22%20and%20%22Invoice%22%20and%20if%20you%20want%20to%20copy%20the%20cell%20A13%20on%20Invoice%20Sheet%20if%20changed%20to%20the%20first%20empty%20cell%20after%20the%20last%20row%20with%20data%20in%20column%20A%20on%20Tracking%20Sheet%2C%20place%20the%20following%20code%20on%20the%20Invoice%20Sheet%20Module.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20do%20so%2C%20right%20click%20on%20Invoice%20Sheet%20Tab%20--%26gt%3B%20View%20Code%20and%20paste%20the%20code%20given%20below%20into%20the%20opened%20code%20window%20and%20save%20your%20workbook%20as%20Macro-Enabled%20Workbook.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20name%20of%20your%20tracking%20sheet%20is%20not%20%22Tracking%22%2C%20change%20the%20name%20of%20tracking%20sheet%20it%20in%20the%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%0AIf%20Target.CountLarge%20%26gt%3B%201%20Then%20Exit%20Sub%0ADim%20wsDest%20%20As%20Worksheet%0A%0ASet%20wsDest%20%3D%20Worksheets(%22Tracking%22)%20%20%20%20%20'Assuming%20Tracking%20is%20the%20name%20of%20the%20Tracking%20Sheet%2C%20change%20it%20as%20required%0A%0AIf%20Target.Address(0%2C%200)%20%3D%20%22A13%22%20Then%0A%20%20%20%20If%20Target%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20Target.Copy%20wsDest.Range(%22A%22%20%26amp%3B%20Rows.Count).End(3)(2)%0A%20%20%20%20End%20If%0AEnd%20If%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20this%20is%20what%20you%20were%20trying%20to%20achieve.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868839%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868839%22%20slang%3D%22en-US%22%3EI%20am%20not%20a%20vb%20person%20how%20do%20I%20make%20it%20loop%3F%20I%20gather%20I%20write%20the%20code%20on%20the%20worksheet%20side%20and%20then%20the%20change%20side%20I%20with%20the%20second%20list%20of%20code%20you%20typed.%20Is%20this%20correct%3F%20Thank%20you%20for%20all%20this%20help.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868851%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868851%22%20slang%3D%22en-US%22%3EThat%20worked%20perfect%2C%20my%20next%20thing%20is%20when%20it%20copies%20invoice%20sheet%20a13%20to%20tracking%20sheet%20column%20a%20is%20there%20a%20way%20it%20can%20copy%20the%20data%20from%20invoice%20sheet%20cells%20d4%2Cd5%2Cd36%20to%20the%20next%20blank%20cells%20in%20tracking%20sheet%20columns%20c%2C%20d%2C%20e%3F%20I%20think%20that%20can%20be%20put%20into%20same%20macro%20just%20like%20a13%20is.%20Not%20sure.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868895%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868895%22%20slang%3D%22en-US%22%3EGot%20everything%20working%20thank%20you%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868996%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868996%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou're%20welcome!%20Glad%20it%20worked%20as%20desired.%3C%2FP%3E%3CP%3EPlease%20take%20a%20minute%20to%20accept%20the%20post%20with%20proposed%20solution%20which%20resolved%20the%20issue%20as%20an%20Answer%20to%20mark%20your%20question%20as%20Solved.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869187%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869187%22%20slang%3D%22en-US%22%3EI%20am%20new%20here%20how%20do%20I%20accept%20as%20solved%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869341%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869341%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESame%20here.%20I%20have%20never%20asked%20any%20question%20here%20so%20not%20aware%20of%20how%20to%20accept%20a%20post%20as%20an%20answer.%3C%2FP%3E%3CP%3EBut%20it%20seems%20you%20will%20find%20a%20button%20called%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20next%20to%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20button%20under%20a%20post.%3C%2FP%3E%3CP%3ERefer%20to%20the%20following%20image%20and%20see%20if%20that's%20the%20case.%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%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%20style%3D%22width%3A%20429px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F133023i35FF7D32CB1E61E3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Best%20Response.jpg%22%20title%3D%22Best%20Response.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-870237%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-870237%22%20slang%3D%22en-US%22%3ESo%20I%20thought%20everything%20was%20working%20fine%20and%20the%20first%20issue%20is%20but%20when%20I%20put%20a%20formula%20in%20cell%20c2%2Cd2%20and%20e2%20it%20copies%20the%20data%20form%20the%20invoice%20sheet.%20But%20when%20I%20input%20a%20new%20acct%20%23%20it%20updates%20c2%20row%20and%20the%20c3%20row.%20I%20do%20not%20want%20it%20to%20update%20the%20previous%20rows%20because%20that%20messes%20up%20the%20tracking%20info.%20How%20can%20I%20do%20this%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-870243%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-870243%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20please%20share%20the%20Change%20Event%20Code%20you%20finally%20have%20on%20Sheet%20Module%3F%3C%2FP%3E%3CP%3EAnd%20then%20explain%20what%20it%20does%20and%20what%20do%20you%20expect%20it%20to%20do%20actually%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-872252%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-872252%22%20slang%3D%22en-US%22%3EAll%20I%20have%20added%20is%20the%20last%20code%20you%20sent%20me%20to%20add%20to%20the%20invoice%20sheet%20and%20it%20works%20fine.%20But%20I%20need%20someway%20to%20copy%204%20other%20fields%20to%20the%20tracking%20sheet%20like%20I%20referenced%20earlier%20to%20you%20with%20out%20changing%20the%20data%20In%20The%20previous%20rows%20to%20match%20this%20current%20data.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-872303%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-872303%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20if%20this%20is%20what%20you%20are%20trying%20to%20achieve.%20Pay%20attention%20to%20the%20comments%20added%20in%20the%20code%20and%20tweak%20it%20as%20per%20your%20requirement.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%0AIf%20Target.CountLarge%20%26gt%3B%201%20Then%20Exit%20Sub%0ADim%20wsDest%20%20As%20Worksheet%0A%0ASet%20wsDest%20%3D%20Worksheets(%22Tracking%22)%20%20%20%20%20'Assuming%20Tracking%20is%20the%20name%20of%20the%20Tracking%20Sheet%2C%20change%20it%20as%20required%0A%0A'Changing%20A13%20on%20Invoice%20sheet%20will%20copy%20A13%20to%20the%20Tracking%20in%20the%20first%20empty%20cell%20after%20the%20last%20row%20with%20data%20in%20Column%20A%0AIf%20Target.Address(0%2C%200)%20%3D%20%22A13%22%20Then%0A%20%20%20%20If%20Target%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20Target.Copy%20wsDest.Range(%22A%22%20%26amp%3B%20Rows.Count).End(3)(2)%0A%20%20%20%20End%20If%0A%0A'Changing%20C2%20on%20Invoice%20sheet%20will%20copy%20C2%20to%20the%20Tracking%20in%20the%20first%20empty%20cell%20after%20the%20last%20row%20with%20data%20in%20Column%20C%0AElseIf%20Target.Address(0%2C%200)%20%3D%20%22C2%22%20Then%0A%20%20%20%20If%20Target%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20Target.Copy%20wsDest.Range(%22C%22%20%26amp%3B%20Rows.Count).End(3)(2)%0A%20%20%20%20End%20If%0A%0A'Changing%20D2%20on%20Invoice%20sheet%20will%20copy%20D2%20to%20the%20Tracking%20in%20the%20first%20empty%20cell%20after%20the%20last%20row%20with%20data%20in%20Column%20D%0AElseIf%20Target.Address(0%2C%200)%20%3D%20%22D2%22%20Then%0A%20%20%20%20If%20Target%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20Target.Copy%20wsDest.Range(%22D%22%20%26amp%3B%20Rows.Count).End(3)(2)%0A%20%20%20%20End%20If%0A%0A'Changing%20E2%20on%20Invoice%20sheet%20will%20copy%20E2%20to%20the%20Tracking%20in%20the%20first%20empty%20cell%20after%20the%20last%20row%20with%20data%20in%20Column%20E%0AElseIf%20Target.Address(0%2C%200)%20%3D%20%22E2%22%20Then%0A%20%20%20%20If%20Target%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20Target.Copy%20wsDest.Range(%22E%22%20%26amp%3B%20Rows.Count).End(3)(2)%0A%20%20%20%20End%20If%0A%20%20%20%20%0AEnd%20If%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-872564%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-872564%22%20slang%3D%22en-US%22%3E%3CBR%20%2F%3EFollowing%20is%20code%20I%20have%20seems%20all%20is%20working%20except%20the%20D35%20cell%20is%20not%20copying%20the%20the%20tracking%20sheet%20D%20column.%20All%20the%20others%20do.%20Any%20idea%20why%3F%3CBR%20%2F%3E%3CBR%20%2F%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3CBR%20%2F%3EIf%20Target.CountLarge%20%26gt%3B%201%20Then%20Exit%20Sub%3CBR%20%2F%3EDim%20wsDest%20As%20Worksheet%3CBR%20%2F%3E%3CBR%20%2F%3ESet%20wsDest%20%3D%20Worksheets(%22Tracking%22)%20'Assuming%20Tracking%20is%20the%20name%20of%20the%20Tracking%20Sheet%2C%20change%20it%20as%20required%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20Target.Address(0%2C%200)%20%3D%20%22A13%22%20Then%3CBR%20%2F%3EIf%20Target%20%26lt%3B%26gt%3B%20%22%22%20Then%3CBR%20%2F%3ETarget.Copy%20wsDest.Range(%22A%22%20%26amp%3B%20Rows.Count).End(3)(2)%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3E%3CBR%20%2F%3EElseIf%20Target.Address(0%2C%200)%20%3D%20%22D4%22%20Then%3CBR%20%2F%3EIf%20Target%20%26lt%3B%26gt%3B%20%22%20%22%20Then%3CBR%20%2F%3ETarget.Copy%20wsDest.Range(%22C%22%20%26amp%3B%20Rows.Count).End(3)(2)%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3E%3CBR%20%2F%3EElseIf%20Target.Address(0%2C%200)%20%3D%20%22D35%22%20Then%3CBR%20%2F%3EIf%20Target%20%26lt%3B%26gt%3B%20%22%20%22%20Then%3CBR%20%2F%3ETarget.Copy%20wsDest.Range(%22D%22%20%26amp%3B%20Rows.Count).End(3)(2)%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3E%3CBR%20%2F%3EElseIf%20Target.Address(0%2C%200)%20%3D%20%22D5%22%20Then%3CBR%20%2F%3EIf%20Target%20%26lt%3B%26gt%3B%20%22%20%22%20Then%3CBR%20%2F%3ETarget.Copy%20wsDest.Range(%22E%22%20%26amp%3B%20Rows.Count).End(3)(2)%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3E%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-873003%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-873003%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat's%20difficult%20to%20answer%20why%20it%20isn't%20working.%20Do%20you%20change%20D35%20manually%3F%20The%20point%20to%20remember%20here%20is%20that%20the%20Change%20Event%20Code%20will%20only%20be%20triggered%20automatically%20when%20you%20change%20the%20content%20of%20the%20cells%20manually%20not%20if%20the%20content%20is%20changed%20through%20formulas.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-873017%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-873017%22%20slang%3D%22en-US%22%3EIt%20is%20a%20column%20that%20sums%20the%20column%20for%20Dollars%20owed%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-873061%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-873061%22%20slang%3D%22en-US%22%3EIs%20there%20a%20way%20to%20do%20this%20for%20the%20column%20that%20calculates%20the%20total%20of%20the%20invoice%20then%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-874471%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-874471%22%20slang%3D%22en-US%22%3ECan%20I%20put%20code%20in%20the%20change%20form%20to%20Calac%20a%20total%20in%20the%20tracking%20form%20or%20not.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-875246%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-875246%22%20slang%3D%22en-US%22%3E%3CBR%20%2F%3ECan%20I%20put%20code%20in%20the%20change%20form%20to%20Calac%20a%20total%20in%20the%20tracking%20sheet%20or%20not.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-875271%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-875271%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412615%22%20target%3D%22_blank%22%3E%40Jtandme%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20unable%20to%20understand%20what%20you%20are%20saying.%3C%2FP%3E%3CP%3EI%20would%20suggest%20you%20to%20open%20a%20new%20question%20with%20your%20new%20requirement%20along%20with%20the%20code%20you%20are%20using%20at%20present.%20Don't%20forget%20to%20upload%20a%20sample%20file%20to%20show%20what%20exactly%20you%20are%20trying%20to%20achieve%20otherwise%20it%20becomes%20difficult%20sometimes%20to%20visualize%20what%20the%20asker%20is%20trying%20to%20achieve%20specially%20when%20description%20is%20not%20very%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Jtandme
Occasional Contributor
I am needing a formula that will check cell a3 if has data go down to next cell, then copy the data from another worksheet called invoice and the cell is a13.
24 Replies

@Jtandme 

I do not think this can be done with a formula, because a conditional formula returns a value but not a selection.

However it could be done by a code in VBA. Also you need to decide how would you like to run that code: Is it manually? or with the opening event of the workbook or with the change happening to a cell you specify?

I need more details or better a sample file to do it properly.

The concept is as follows

ALT + F11 >> opens the VB editor

ALT + I + M >> creates a module

then type:

Sub Evaluate()

   If Range("A3"). value <> "" Then

      Range("A4"). select

      ActiveCell.value= Sheets("Invoice").Range("A13").value

   End If

End Sub

 

 

Hope that helps

Nabil Mourad

 

 

 

@Jtandme 

Or place this formula in A4

=IF(A3="","",Invoice!A13)

@Jtandme 

Hi again

In my answer I focused on "SELECTING" the cell below assuming that you want this cell to be selected.

However if "Selecting A4" is not a must then, without a doubt go with the nice formula provided by our team mate @Subodh_Tiwari_sktneer 

Thank you

Nabil Mourad

I need the code to run when the data changes in the invoice sheet a13 so to copy the info to a tracking sheet.
Also reasoning for checking cell a3 was so not to over write the data. I need the code to check the last cell in the column with data then move down to next vacant cell and Copy data from invoice sheet a13 into the black cell. Sorry for the confusion.

@Jtandme 

Hi

To run the code whenever A13 changes in the Invoice worksheet, then

You need to attach the code to cell A13 Change event:

To do that,

Right click the worksheet Tab (Invoice) >> select view code

In the VB Editor, you have 2 drop lists, from the left one select "Worksheet" from the Right one select "Change"

Loop.png

 

 
 

Then write the code:

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("A13").Address Then
Call Evaluate
End If
End Sub

 

If you want to check if a cell is empty then proceed to the cell below without overwriting, that requires modifying the Evaluate code and let it loop before copying.

Solution

@Jtandme 

Based on your description, assuming you have two sheets called "Tracking" and "Invoice" and if you want to copy the cell A13 on Invoice Sheet if changed to the first empty cell after the last row with data in column A on Tracking Sheet, place the following code on the Invoice Sheet Module.

 

To do so, right click on Invoice Sheet Tab --> View Code and paste the code given below into the opened code window and save your workbook as Macro-Enabled Workbook.

 

If name of your tracking sheet is not "Tracking", change the name of tracking sheet it in the code.

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
Dim wsDest  As Worksheet

Set wsDest = Worksheets("Tracking")     'Assuming Tracking is the name of the Tracking Sheet, change it as required

If Target.Address(0, 0) = "A13" Then
    If Target <> "" Then
        Target.Copy wsDest.Range("A" & Rows.Count).End(3)(2)
    End If
End If
End Sub

 

Let me know if this is what you were trying to achieve.

I am not a vb person how do I make it loop? I gather I write the code on the worksheet side and then the change side I with the second list of code you typed. Is this correct? Thank you for all this help.
That worked perfect, my next thing is when it copies invoice sheet a13 to tracking sheet column a is there a way it can copy the data from invoice sheet cells d4,d5,d36 to the next blank cells in tracking sheet columns c, d, e? I think that can be put into same macro just like a13 is. Not sure.
Got everything working thank you

@Jtandme 

You're welcome! Glad it worked as desired.

Please take a minute to accept the post with proposed solution which resolved the issue as an Answer to mark your question as Solved.

I am new here how do I accept as solved?

@Jtandme 

Same here. I have never asked any question here so not aware of how to accept a post as an answer.

But it seems you will find a button called Mark as Best Response next to Like button under a post.

Refer to the following image and see if that's the case.

 

Best Response.jpg

So I thought everything was working fine and the first issue is but when I put a formula in cell c2,d2 and e2 it copies the data form the invoice sheet. But when I input a new acct # it updates c2 row and the c3 row. I do not want it to update the previous rows because that messes up the tracking info. How can I do this?

@Jtandme 

Can you please share the Change Event Code you finally have on Sheet Module?

And then explain what it does and what do you expect it to do actually?

 

All I have added is the last code you sent me to add to the invoice sheet and it works fine. But I need someway to copy 4 other fields to the tracking sheet like I referenced earlier to you with out changing the data In The previous rows to match this current data.

@Jtandme 

 

See if this is what you are trying to achieve. Pay attention to the comments added in the code and tweak it as per your requirement.

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
Dim wsDest  As Worksheet

Set wsDest = Worksheets("Tracking")     'Assuming Tracking is the name of the Tracking Sheet, change it as required

'Changing A13 on Invoice sheet will copy A13 to the Tracking in the first empty cell after the last row with data in Column A
If Target.Address(0, 0) = "A13" Then
    If Target <> "" Then
        Target.Copy wsDest.Range("A" & Rows.Count).End(3)(2)
    End If

'Changing C2 on Invoice sheet will copy C2 to the Tracking in the first empty cell after the last row with data in Column C
ElseIf Target.Address(0, 0) = "C2" Then
    If Target <> "" Then
        Target.Copy wsDest.Range("C" & Rows.Count).End(3)(2)
    End If

'Changing D2 on Invoice sheet will copy D2 to the Tracking in the first empty cell after the last row with data in Column D
ElseIf Target.Address(0, 0) = "D2" Then
    If Target <> "" Then
        Target.Copy wsDest.Range("D" & Rows.Count).End(3)(2)
    End If

'Changing E2 on Invoice sheet will copy E2 to the Tracking in the first empty cell after the last row with data in Column E
ElseIf Target.Address(0, 0) = "E2" Then
    If Target <> "" Then
        Target.Copy wsDest.Range("E" & Rows.Count).End(3)(2)
    End If
    
End If
End Sub

Following is code I have seems all is working except the D35 cell is not copying the the tracking sheet D column. All the others do. Any idea why?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
Dim wsDest As Worksheet

Set wsDest = Worksheets("Tracking") 'Assuming Tracking is the name of the Tracking Sheet, change it as required

If Target.Address(0, 0) = "A13" Then
If Target <> "" Then
Target.Copy wsDest.Range("A" & Rows.Count).End(3)(2)
End If

ElseIf Target.Address(0, 0) = "D4" Then
If Target <> " " Then
Target.Copy wsDest.Range("C" & Rows.Count).End(3)(2)
End If

ElseIf Target.Address(0, 0) = "D35" Then
If Target <> " " Then
Target.Copy wsDest.Range("D" & Rows.Count).End(3)(2)
End If

ElseIf Target.Address(0, 0) = "D5" Then
If Target <> " " Then
Target.Copy wsDest.Range("E" & Rows.Count).End(3)(2)
End If

End If
End Sub

@Jtandme 

That's difficult to answer why it isn't working. Do you change D35 manually? The point to remember here is that the Change Event Code will only be triggered automatically when you change the content of the cells manually not if the content is changed through formulas.

It is a column that sums the column for Dollars owed
Is there a way to do this for the column that calculates the total of the invoice then?
Can I put code in the change form to Calac a total in the tracking form or not.

Can I put code in the change form to Calac a total in the tracking sheet or not.

@Jtandme 

I am unable to understand what you are saying.

I would suggest you to open a new question with your new requirement along with the code you are using at present. Don't forget to upload a sample file to show what exactly you are trying to achieve otherwise it becomes difficult sometimes to visualize what the asker is trying to achieve specially when description is not very helpful.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies