Carriage Returns in Headings but if used in Range wont find

shell_l_d

Board Regular
Joined
Jun 25, 2010
Messages
73
If I enter carriage returns of Chr(10) in a cell, I cant seem to select the cell heading in the code below unless i take out the Chr(10) code. Is there a trick to this please?

Code:
        ' Extra Headings
        .Cells(row, col + 1).FormulaR1C1 = "Calc" & Chr(10) & "Eval Date"
        
        ' Extra Values
        .Cells(row + 1, col + 1).FormulaR1C1 = "=IF(RC9=""Null"",DATE(2010,3,31),RC9)"

        ' Date Time field format
        Range("tblGlobalData[[Calc Eval Date]:[Calc Compl Date]]").NumberFormat = "dd mmm yyyy hh:mm"
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Enter it into the heading cell as "Calc Eval Date" and format the cells' alignment property as wrap text. Use it in formulas the same way, "Calc Eval Date."
 
Upvote 0
Yeah I'm already using it that way, only problem is when use AutoFit, it makes a difference if the heading is:

Calc Eval Date

or

Calc
Eval Date
 
Upvote 0
Do it that way, note the column width, add a hard code width in your code after each Autofit. I know it's a PITA, but that's Excel.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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