Default value in cell depending on other cell value

Bill Morris

New Member
Joined
Aug 1, 2011
Messages
41
Hi

I have posted something similar to this before.

I have a spreadsheet whereby I want a formula or <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-bottom-style: dotted; border-bottom-color: rgb(0, 0, 0); cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym> code to apply depending upon if another cell contains anything.

For example

On sheet "Data", Range "C38:onwards" may contain text. In N38: the user can add text, but if it is left blank then I want a dash ("-") as the default value. This applies to C39 (N39), C40 (N40).....etc

If any of the cells in the C38: range are blank then I want the corresponding (offset (0, 11) cell in the N column to be left blank.

I need the code to check column "C" from cell C38 until it reaches a blank cell.




Thanks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Correct and that is what the macro should be doing.
as you said in post #5:-


starting at C38. Where cells in this range are not blank I require the corresponding cell in column N to contain either the default "-" or the user can input text in this cell.

Or you need anything else ?


Regards,
DILIPandey
 
Upvote 0
Because your data starts much above then row 38.

See, the code looks data in "c38 to end cell" containg data in that c column and since it is not finding that (the end cell in c with data after c38), it starts populating data on the above side.


Regards,
DILIPandey
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

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