MS Excel help

bibhu_datta_rout

New Member
Joined
Jun 8, 2008
Messages
4
Hi, I have a excel spreadsheet which has order in one column and event1 and event2 in two other columns.One order can have multiple events.In the given spreadsheet. When an order has muliple events, then except first record, all other cells of order column is NULL. I want to populate those null cells with the just above orders.
e.g. before
order event1 event2
1 abc def
bac1 def1
bac def
2 abc def
abc def
def ghi
3 def ghi
After
order event1 event2
1 abc def
1 bac1 def1
1 bac def
2 abc def
2 abc def
2 def ghi
3 def ghi

This I could do with macro as follows
====================

Sub specialmacro()Dim rng As RangeDim celle As RangeDim str1 As StringDim str2 As StringDim rowe As Long rowe = 1str1 = "A"str2 = "A"With Sheets("Sheet1") Set rng = Range(.Cells(rowe, str1), .Cells(.Cells.Rows.Count, str2).End(xlUp))End With For Each celle In rng If celle = "" Then celle = celle.Offset(-1, 0) End IfNext celle End Sub========================</PRE>
Now my problem is after running the macro, I do some modifications.</PRE>
Once the modifcation done, I want to bring it back to before format.</PRE>
i.e.something like </PRE>
order event1 event2
1 abc def
bac1 def1
bac def
2 abc def
abc def
def ghi
3 def ghi
</PRE>
Is that possible? Thanks for your help.</PRE>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Welcome to the MrExcel board!

See if this does what you want.

To fill the blanks:
1. Select column A by clicking its heading label.
2. Edit|GoTo...|Special...|Blanks|OK
3. Type the = sign followed by the up arrow and confirm with Ctrl+Enter

Do you modifications (hopefully not involving sorting as this may cause some problems with these formulas)

To remove:
1. Select column A
2. Edit|Go To...|Special...|Formulas|OK
3. Press the Delete key
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top