ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for copying cells above empty cells (https://www.excelbanter.com/excel-programming/396005-macro-copying-cells-above-empty-cells.html)

JRB1024

Macro for copying cells above empty cells
 
I'm having trouble makin a macro for the following:
In column A I have varying entries of numbers or blank cells. If the
cell is blank I need it to go to the nearest cell above it and copy
that number. For example

A1=443
A2=
A3=
A4=558
A5=


I would need A2 and A3 to be filled with 443 and A5 to be filled with
558. please help!


Bob Phillips

Macro for copying cells above empty cells
 
See previous post

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JRB1024" wrote in message
ups.com...
I'm having trouble makin a macro for the following:
In column A I have varying entries of numbers or blank cells. If the
cell is blank I need it to go to the nearest cell above it and copy
that number. For example

A1=443
A2=
A3=
A4=558
A5=


I would need A2 and A3 to be filled with 443 and A5 to be filled with
558. please help!




Pranav Vaidya

Macro for copying cells above empty cells
 
you can do this without a macro

Select the range
hit CTRL+G (Goto)
Select 'Special'
In specil window select 'Blanks'
now click on OK
Now only blank cells are selected
hit CTRL+D, this will copy the details from top cell to below blank cells only
then you can do a copy-paste special values on a safer side.

--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"JRB1024" wrote:

I'm having trouble makin a macro for the following:
In column A I have varying entries of numbers or blank cells. If the
cell is blank I need it to go to the nearest cell above it and copy
that number. For example

A1=443
A2=
A3=
A4=558
A5=


I would need A2 and A3 to be filled with 443 and A5 to be filled with
558. please help!



JRB1024

Macro for copying cells above empty cells
 
On Aug 21, 10:19 am, "Bob Phillips" wrote:
See previous post

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JRB1024" wrote in message

ups.com...



I'm having trouble makin a macro for the following:
In column A I have varying entries of numbers or blank cells. If the
cell is blank I need it to go to the nearest cell above it and copy
that number. For example


A1=443
A2=
A3=
A4=558
A5=


I would need A2 and A3 to be filled with 443 and A5 to be filled with
558. please help!- Hide quoted text -


- Show quoted text -


When I hit ctr-D it does nothing.


JRB1024

Macro for copying cells above empty cells
 
On Aug 21, 10:28 am, JRB1024 wrote:
On Aug 21, 10:19 am, "Bob Phillips" wrote:





See previous post


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"JRB1024" wrote in message


oups.com...


I'm having trouble makin a macro for the following:
In column A I have varying entries of numbers or blank cells. If the
cell is blank I need it to go to the nearest cell above it and copy
that number. For example


A1=443
A2=
A3=
A4=558
A5=


I would need A2 and A3 to be filled with 443 and A5 to be filled with
558. please help!- Hide quoted text -


- Show quoted text -


When I hit ctr-D it does nothing.- Hide quoted text -

- Show quoted text -


What formula would you guys recommend to use?



All times are GMT +1. The time now is 05:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com