# Excel formula

I need:

-If B14=empty, then A and D colones both empty

-If only B14=selected, then A14=TREZOR, D14=1, D15=1, bold underline between C14-L14 and C15-L15, others A and D empty

-If B14=selected and B15=selected, then A14=TREZOR, A15=-II-, D14=1, D15=1, D16=2, bold underline between C15-L15 and C16-L16, others A and D empty

-If B14=selected and B15=selected and B16=selected, then A14=TREZOR, A15=-II-, A16=-II-, D14=1, D15=1, D16=1, D17=3, bold underline between C16-L16 and C17-L17, others A and D empty

...and so troughout

Thanks

Attached Files
 spisak.xls (26.5 KB, 89 views)
 Pajoooo Posts: 57, Reputation: 1 Junior Member #2 Jul 1, 2009, 02:39 PM
Quote:
 Originally Posted by Pajoooo Download Attachment, first. I need: -If B14=empty, then A and D colones both empty -If only B14=selected, then A14=TREZOR, D14=1, D15=1, bold underline between C14-L14 and C15-L15, others A and D empty -If B14=selected and B15=selected, then A14=TREZOR, A15=-II-, D14=1, D15=1, D16=2, bold underline between C15-L15 and C16-L16, others A and D empty -If B14=selected and B15=selected and B16=selected, then A14=TREZOR, A15=-II-, A16=-II-, D14=1, D15=1, D16=1, D17=3, bold underline between C16-L16 and C17-L17, others A and D empty ...and so troughout Thanks
Here are what's shall

 JBeaucaire Posts: 5,377, Reputation: 5036 Software Expert #3 Jul 1, 2009, 03:07 PM

The formula in D14 is different from the rest of the formulas in D15 down, so don't mix them up.

D15: =IF(B15<>0,1,IF(B14<>0,SUM(\$D\$14:D14),""))

The BOLD LINE thing is being handled with conditional formatting.
Attached Files
 Spisak.xls (28.5 KB, 75 views)
 Pajoooo Posts: 57, Reputation: 1 Junior Member #4 Jul 2, 2009, 05:09 PM
Quote:
 Originally Posted by JBeaucaire The formula in D14 is different from the rest of the formulas in D15 down, so don't mix them up. D15: =IF(B15<>0,1,IF(B14<>0,SUM(\$D\$1414),"")) The BOLD LINE thing is being handled with conditional formatting.

Thanks,JBeaucaire. That is it... BUT!

SEE PICTURES ABOVE, AGAIN

Can You set conditional formatting WITHOUT red line, AND black line extend to columns K and L.

 JBeaucaire Posts: 5,377, Reputation: 5036 Software Expert #5 Jul 2, 2009, 07:23 PM

Here you go...
Attached Files
 Spisak.xls (33.5 KB, 70 views)
 Pajoooo Posts: 57, Reputation: 1 Junior Member #6 Jul 12, 2009, 03:59 AM
Hello,

See picture

I can't set red line to black border.
Row 48 MUST BE intact.

Anything else OK.
 JBeaucaire Posts: 5,377, Reputation: 5036 Software Expert #7 Jul 12, 2009, 07:15 AM

Here you go:
Attached Files
 Spisak.xls (28.0 KB, 76 views)
 Pajoooo Posts: 57, Reputation: 1 Junior Member #8 Jul 15, 2009, 02:20 PM
FOR JBeaucaire, primarily

I now that is to much from me, but I'm enforced to complet this app.

1. Black border between C and L columns in transition between first and second page

2. VBA script for printing. Requirement:

When B14 selected, then print pages 1,2
When B14,B15 selected, then print pages 1,2
When B14,B15,B16 selected, then print pages 1,2,3
When B14,B15,B16,B17 selected, then print pages 1,2,3
When B14,B15,B16,B17,B18 selected, then print pages 1,2,3,4
When B14,B15,B16,B17,B18,B19 selected, then print pages 1,2,3,4
When B14,B15,B16,B17,B18,B19,B20 selected, then print pages 1,2,3,4,5
When B14,B15,B16,B17,B18,B19,B20,B21 selected, then print pages 1,2,3,4,5
When B14,B15,B16,B17,B18,B19,B20,B21,B22 selected, then print pages 1,2,3,4,5,6
When B14,B15,B16,B17,B18,B19,B20,B21,B22,B23 selected, then print pages 1,2,3,4,5,6
When B14,B15,B16,B17,B18,B19,B20,B21,B22,B23,B24 selected, then print pages 1,2,3,4,5,6,7
When B14,B15,B16,B17,B18,B19,B20,B21,B22,B23,B24,B25 selected, then print pages 1,2,3,4,5,6,7

Trigger for print: Print button (Standard Toolbars)

Attached Files
 pisak.xls (96.0 KB, 64 views)
 JBeaucaire Posts: 5,377, Reputation: 5036 Software Expert #9 Jul 15, 2009, 06:12 PM

Rather than fiddle with cell selection, this will simply ask you how many sheets you want to print.
Code:
```Sub PrintMacro()
Dim Cnt As Long

Cnt = Application.InputBox("Print how many sheets? (1-7)", Title:="Print Sheets", Type:=2)
If Cnt = False Or Cnt > 7 Then Exit Sub
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=Cnt, Copies:=1, Collate:=True
End Sub```
How to use the macro:

2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)

The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.

Or, insert a Forms Button from the Forms Toolbar, once on the sheet it will popup a list of the macros in your sheet, select the print macro above.
 Pajoooo Posts: 57, Reputation: 1 Junior Member #10 Jul 16, 2009, 12:14 AM
Thanks, JBeaucaire, this macro is useful for me, but what about "Black border between C and L columns in transition between first and second page"?

## Check out some similar questions!

I need a excel formula [ 2 Answers ]

Hi I need a excel formula for numbers ( Figures) are convert in words. Like Rs.20 =Twenty only( In Formula) up to 15 digit. Thanks Regards Hariom

Excel formula [ 1 Answers ]

I have more questions about excel formula. In one column I have data appearing, as either a 1 or 2, at random as I input it. Each column has around 120 rows. In the row at the bottom I created a formula to calculate how often, on average, the data appears in that column. 1st how do I get each row...

Excel formula [ 3 Answers ]

I am using Excel 2007. I have 2 Sheets. In first sheet there are 3 coloumns, first one contains the employes number, second coloumn contains the name of employes and third one containes the department he works in. In the second sheet I have drop down list of the names of employes and the...

Excel Formula [ 1 Answers ]

Hi I have come across another problem with my spreadsheet. I have tried quite a few different ways to do it but can't get any of them to work. Within my spreadsheet I have a quote price and a forcasted date. However when a order is definitely received then a sale price and a new date is put into...

Excel formula [ 3 Answers ]

I have a column that you manually enter a number; either 0 (zero) or any number greater than zero. I have another column with the formula of: =DAYS360(AN22,AQ22) If the resulting formula figure/number is greater than the manually entered number then I want a third column to equal: \$0.00 But...