kcampbell675
New Member
- Joined
- Sep 19, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hello, I am attempting to unhide rows via Excel VBA if a particular selection is made. The workbook is intended for internal customers to complete for capital requests; thus it is form workbook. When the user selects the "Software/License" category other rows will unhide with further questions. The other caveat there are a number of rows for a category selection which may not be the "Software/License" category selected by the user. The code needs to unhide rows 14 - 17 as long as one row in col. "F" (Category) has selected "Software/ Licenses. I am having difficulty writing the code and making the correct VBA selections. The current issues I have the if I add a category selection that is not "Software/Licenses" despite having another row with the aforementioned selection, the rows re-hide. I have tried integer code unsuccessfully. I would appreciate any assistance. Thanks you! My current code is below.
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("$f$22:$F$86"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Software/License": Rows("14:19").EntireRow.Hidden = False
Case Is <> "Software/License": Rows("14:19").EntireRow.Hidden = True
End Select
End If
End Subject
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("$f$22:$F$86"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Software/License": Rows("14:19").EntireRow.Hidden = False
Case Is <> "Software/License": Rows("14:19").EntireRow.Hidden = True
End Select
End If
End Subject
CPR form Materials & Labor tab for K Campbell.xlsm | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
1 | Capital Purchase Request Form - 2024 | Return to CPR Form | |||||||||||||||
2 | V1-11/03/2023 | ||||||||||||||||
3 | Materials & Labor | ||||||||||||||||
4 | Project Name: ACCOUNTS RECEIVABLE AND BILLING SYSTEM | ||||||||||||||||
5 | Special Instructions and Notes | Category | Ext Price | Freight | Tax | Total | |||||||||||
6 | Hardware | - | |||||||||||||||
7 | Software/License | - | |||||||||||||||
8 | Labor | - | |||||||||||||||
9 | Other Capital | - | |||||||||||||||
10 | Ship To Address | ` | - | ||||||||||||||
11 | Ship To City, State Zip | Disposal | - | ||||||||||||||
12 | Ship to Contact Person | Total | - | - | - | - | |||||||||||
13 | |||||||||||||||||
14 | Software license capitalization criteria (all criteria below must be "Yes" to proceed as a capital request) | Software license approvals | |||||||||||||||
15 | SR ownership &/or control of software on premise or cloud | select | Please answer all 3 questions. | DOA (Delegation of authority) approval | select | Please answer. | |||||||||||
16 | At least 1 year term for software license / renewal | select | PRB (Project Review Board) approval number | ||||||||||||||
17 | At least 1 year term is non-cancelable | select | ARB (Architecture Review Board) approval number | ||||||||||||||
18 | |||||||||||||||||
19 | Freight Percent | Sales Tax Rate | |||||||||||||||
20 | Quote Detail | 0.00% | 0.00% | ||||||||||||||
21 | Vendor Name | Quote Number | Line # | Description | Category | Ext Price | Freight | Tax | Total | ||||||||
22 | Software/License | - | - | - | |||||||||||||
23 | Hardware | - | - | - | |||||||||||||
24 | - | - | - | ||||||||||||||
25 | - | - | - | ||||||||||||||
26 | - | - | - | ||||||||||||||
27 | - | - | - | ||||||||||||||
28 | - | - | - | ||||||||||||||
29 | - | - | - | ||||||||||||||
30 | - | - | - | ||||||||||||||
31 | - | - | - | ||||||||||||||
32 | - | - | - | ||||||||||||||
33 | - | - | - | ||||||||||||||
34 | - | - | - | ||||||||||||||
Materials & Labor |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B1 | B1 | ='https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$A$1 |
B2 | B2 | ='https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$A$2 |
B3 | B3 | =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) |
B4 | B4 | =IF('https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$C$20="select","",IF('https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$C$20<>"****Project not in list****",CONCATENATE("Project Name: ",'https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$C$20),IF('https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$C$20="****Project not in list****",CONCATENATE("Project Name: ",'https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]CPR Request Form'!$C$24)))) |
G6:G11 | G6 | =IF(OR($E$15="Please answer all 3 questions.",$E$16="Software not capitalizable.")," ",SUMIF('https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]Materials & Labor'!$F$23:$F$86,[@Category],'https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]Materials & Labor'!$G$22:$G$86)) |
H6:H11 | H6 | =IF(OR($E$15="Please answer all 3 questions.",$E$16="Software not capitalizable.")," ",SUMIF('https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]Materials & Labor'!$F$23:$F$86,[@Category],'https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]Materials & Labor'!$H$22:$H$86)) |
I6:I11 | I6 | =IF(OR($E$15="Please answer all 3 questions.",$E$16="Software not capitalizable.")," ",SUMIF('https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]Materials & Labor'!$F$23:$F$86,[@Category],'https://chartercom-my.sharepoint.com/personal/ken_campbell_charter_com/Documents/Documents/Ken main/Capital Forms & Instructions/2024/[CPR Form_2024 v1 beta new working.xlsm]Materials & Labor'!$I$22:$I$86)) |
J6:J11 | J6 | =SUM(Table2[@[Ext Price]:[Tax]]) |
G12 | G12 | =SUBTOTAL(109,[Ext Price]) |
H12 | H12 | =SUBTOTAL(109,[Freight]) |
I12 | I12 | =SUBTOTAL(109,[Tax]) |
J12 | J12 | =SUBTOTAL(109,[Total]) |
J15 | J15 | =IF($I$15="select","Please answer."," ") |
E15 | E15 | =IF($D$15="select","Please answer all 3 questions.",IF($D$16="select","Please answer all 3 questions.",IF($D$17="select","Please answer all 3 questions."," "))) |
E16 | E16 | =IF($D$15="No","Software not capitalizable.",IF($D$16="No","Software not capitalizable.",IF($D$17="No","Software not capitalizable."," "))) |
H22:H34 | H22 | =$G22*$H$20 |
I22:I34 | I22 | =$G22*$I$20 |
J22:J34 | J22 | ='Materials & Labor'!$G22+'Materials & Labor'!$H22+'Materials & Labor'!$I22 |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
B4 | Cell Value | contains "" | text | NO |
B3 | Cell Value | contains "" | text | NO |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
F22:F34 | List | =$F$6:$F$11 |
H20:I20 | Whole number | between 0 and 1 |