We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Excel VBA Copy previous row cell value

Chrissim16
Chrissim16 asked
on
Medium Priority
1,517 Views
Last Modified: 2012-05-11
Hi there,

I have an Excel file where in the B column the uneven row cells have a value but the even row cells do not have value. I would like to copy the value of the uneven cell to the even cell. For example, B2= B1, B4=B3,B6=B5 etc. It should also look solely at this range, not at the whole sheet. I need a VB solution for this.  I tried to record a macro using the special values (F5) for blanks, but then I get a circular reference. Anyone got an idea?
Comment
Watch Question

Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
@Bala: Thanks, it worked perfectly!!
@ShivaKK: Yours almost worked perfectly, but it dod not copy the value for the last row, but thanks very much for help
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.