Vba or formula please

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,851
Office Version
  1. 365
Platform
  1. Windows
[TABLE="width: 64"]
<TBODY>[TR]
[TD][TABLE="width: 1088"]
<TBODY>[TR]
[TD="colspan: 7"]I have rows headings in column A, like Batch#, AFE#, Business Unit etc.</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 10"]one of the question is Child? In cell A7, If user types YES in B7, then the Next cell A8 has "parent#".
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]Then user has to type Parent # in cell B8</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 8"]From A8, I used formual, If B7 has Yes than Parent # otherwise Item number,</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 9"]in A9 I wrote another formaula if A9 is Item number then Serial # otherwise Asset #</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]and so on. </SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 17"]I am sure there must be a better way, like, if the answer in B7 is Yes then A8 will be Parent # and the rest will move down by one cell, instead of using so many formulas.</SPAN>
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 6"]I know it could be done by VBA. But I do not know VBA.</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thanks</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]
I have rows headings in column A, like Batch#, AFE#, Business Unit etc.</SPAN>[/TD]
[/TR]
[TR]
[TD]one of the question is Child? In cell A7, If user types YES in B7, then the Next cell A8 has Parent #. </SPAN>
[/TD]
[/TR]
[TR]
[TD]Then user has to type Parent # in cell B8</SPAN>
[/TD]
[/TR]
[TR]
[TD]From A8, I used formual, If B7 has Yes than Parent # otherwise Item number,</SPAN>
[/TD]
[/TR]
[TR]
[TD]in A9 I wrote another formaula if A9 is Item number then Serial # otherwise Asset #</SPAN>
[/TD]
[/TR]
[TR]
[TD]and so on. </SPAN>
[/TD]
[/TR]
[TR]
[TD]I am sure there must be a better way, like, if the answer in B7 is Yes then A8 will be Parent # and the rest will move down by one cell, instead of using so many formulas.</SPAN>
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]I know it could be done by VBA. But I do not know VBA.</SPAN>
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Thanks</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
[TABLE="width: 192"]
<TBODY>[TR]
[TD]BATCH #</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AFE #</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Business Unit</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Branch Plant</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dr Obj Acct</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cr Obj Acct</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Child?</SPAN>[/TD]
[TD]YES</SPAN>[/TD]
[/TR]
[TR]
[TD]Parent #</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item Number</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Serial Number</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Asset Number</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]DPIS (Date Placed In Service)</SPAN>[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lease Expiry Date</SPAN>[/TD]
[TD][/TD]
[/TR]
</TBODY><COLGROUP><COL><COL></COLGROUP>[/TABLE]
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,222,248
Messages
6,164,815
Members
451,918
Latest member
Pinnacleinfotechcad

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