Excel Copy Cell Above or Below | VBA Macro #14

Macro Intro

Have you run into this problem? You are completing an export of records with a variety of items some of them having multiple lines of values. After completing your export, you realize there are blank rows that should have the values of the cells above or below. Which is extremely frustrating if the unique identifier is missing values that it should be associated with. A situation like this can leave you wondering “Now what?” This is why Leverage & Lean created the Copy Cell Above or Below macro that can assist you with populating all of these empty cells. Once you run this Excel macro an InputBox will appear to determine if you want the cell values from above or below the blank cells. Indicate your selection with a 1 or 2 then watch at the blank cells transform into their appropriate values. (This macro is customizable allowing you to default either the Above or Below cell avoiding the InputBox altogether)

See it in Action

Watch this video to see this macro in action.

Code

Here is the code for this macro. Make sure the following References are setup before running it: Visual Basic For Applications, Microsoft Excel 16.0 Object Library
Search

First time using VBA?

The Developer Tab is an additional section of the ribbon when activated allows you access to Visual Basic in Applications like Access, Excel, Outlook, PowerPoint, Word.
Setup Now
Once the Developer Tab is available you will have the capability to update your security to allow Macros to run in the current application.
Setup Now
A sub of code is a collection of objects and variables. For the code to successfully run a library of references needs to be set.
Setup Now
Subscribe as an Insider to receive additional rights.
If you like our content and want to show your support tip us here!

Contact Us

Looking to improve your computer processes?
Leverage & Lean is here to help!

Powered By MemberPress WooCommerce Plus Integration

Free Macro

Start creating Less Clicks, More Results today!