Question: Paste the VBA function that you write into the textbox. I should be able to copy and paste your function and it work within my

Paste the VBA function that you write into the textbox. I should be able to copy and paste your function and it work within my spreadsheet.
Write a function called SumAdjacentDigitProducts that takes a single positive integer as input. The function should perform the following operations:
Parse the given integer, starting with the leftmost digit.
Multiply the current digit by the digit immediately to its right.
Move one digit to the right and repeat step 2 until all adjacent pairs of digits have been multiplied.
Add the products obtained in steps 2 and 3 for all of the digit pairs.
Return the final sum.
Example:
Input: 12345 Output: 44
Explanation: (12)+(23)+(34)+(45)=2+6+12+20=44

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!