Macro to fill in subsequent data

raghu2013

New Member
Joined
Jun 12, 2013
Messages
14
raghu

Got a doubt:
Excel spreadsheet, the rows are:

1-62
1-63
Blank cell
1-75
1-76
Blank cell

My requirement is: wherever there is a Blank cell, it should be populated with the previous cell number +1
and placed within brackets.

For example the first Blank cell should become (1-64)
The next Blank cell should become (1-77)

Like this, there are hundreds of rows.
This should happen automatically through a script/formula/macro.

Need urgent help.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Excel spreadsheet, the rows are:

1-62
1-63
Blank cell
1-75
1-76
1-77
1-77.1
Blank cell

My requirement is: wherever there is a blank cell, it should be populated with the subsequent number within brackets.
for example the first blank cell should become (1-64)
the next blank cell should become (1-77.2)
there are hundreds of entries.
This should happen automatically through a script.
Need urgent help please.
 
Upvote 0
Re: raghu2013

Welcome to the Board!

In the future, please use a descriptive thread title (which I have changed for you). Your user name says nothing about the issue.
 
Upvote 0
Re: raghu


Excel 2010
AB
11-621-62
21-631-63
3Blank cell1-64
41-751-75
51-761-76
6Blank cell1-77
Sheet3
Cell Formulas
RangeFormula
B3=LEFT(B2,FIND("-",B2))&RIGHT(B2,LEN(B2)-FIND("-",B2))+1
B6=LEFT(B5,FIND("-",B5))&RIGHT(B5,LEN(B5)-FIND("-",B5))+1


then you can filter that column for blanks and copy the formula to those cells
 
Upvote 0
Hi raghu2013,

Are the parentheses just to identify that the cell used to be blank?

AP

very simple: i want the cell the read as (1-64), i.e., within parenthesis. it is irrelevant to me as to the purpose.
This is a simple and direct question. i d not know as to the relevance of your doubt.
Very simple: if the previous cell is 1-63, then i want the next cell to read as (1-64)
if the previous cell is 1-73.1, then i want the next cell to read as (1-73.2)
very simple question.
 
Upvote 0
Re: raghu

Excel 2010
AB
11-621-62
21-631-63
3Blank cell1-64
41-751-75
51-761-76
6Blank cell1-77

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
B3=LEFT(B2,FIND("-",B2))&RIGHT(B2,LEN(B2)-FIND("-",B2))+1
B6=LEFT(B5,FIND("-",B5))&RIGHT(B5,LEN(B5)-FIND("-",B5))+1

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



then you can filter that column for blanks and copy the formula to those cells

No, this does not work. firstly, why did you add another column B? this is not what i asked for.
very simple. there is only one column A. if i copy the above formula, with suitable modifications, the formula
just gets copied to the cell. no sorry, this did not work.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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