Home

VBA Code (Ifblank then do this)

%3CLINGO-SUB%20id%3D%22lingo-sub-699883%22%20slang%3D%22en-US%22%3EVBA%20Code%20(Ifblank%20then%20do%20this)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-699883%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20writing%20a%20code%20to%20go%20to%20the%20last%20row%20of%20column%20L%20in%20a%20dataset.%20If%20the%20cell%20is%20blank%20then%20I%20want%20to%20it%20go%20up%20one%20cell%20and%20over%20to%20the%20right%203%20cells%2C%20copy%20and%20paste%20the%20data%20from%20cells%20n%3Ap%20then%20paste%20that%20data%20in%20the%20n%3Ap%20cells%20above%20the%20cells%20that%20were%20just%20copied%20(for%20example%3B%20start%20at%20L74%2C%20then%20go%20up%20to%20L73%2C%20if%20L73%20is%20blank%20then%20go%20over%20to%20N73%3AP73%20and%20copy%20that%20data%2C%20then%20go%20up%20and%20paste%20that%20data%20into%20N72%3AP72%2C%20and%20then%20clear%20the%20data%20from%2073.%20After%20words%20i%20want%20it%20to%20go%20N72%2C%20which%20is%20not%20blank%20so%20a%20formula%20to%20say%20if%20not%20blank%20then%20proceed%20to%20N71%20and%20search%20if%20blank%20and%20repeat%20the%20same%20steps).%20The%20data%20will%20not%20always%20start%20at%20the%20same%20location%20so%20a%20fluid%20code%20is%20needed.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-699883%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
James_Morris
Occasional Visitor

Hello All,

 

I am writing a code to go to the last row of column L in a dataset. If the cell is blank then I want to it go up one cell and over to the right 3 cells, copy and paste the data from cells n:p then paste that data in the n:p cells above the cells that were just copied (for example; start at L74, then go up to L73, if L73 is blank then go over to N73:P73 and copy that data, then go up and paste that data into N72:P72, and then clear the data from 73. After words i want it to go N72, which is not blank so a formula to say if not blank then proceed to N71 and search if blank and repeat the same steps). The data will not always start at the same location so a fluid code is needed. 

 

Thank you,