• Курсы Академии Кодебай, стартующие в мае - июне, от команды The Codeby

    1. Цифровая криминалистика и реагирование на инциденты
    2. ОС Linux (DFIR) Старт: 16 мая
    3. Анализ фишинговых атак Старт: 16 мая Устройства для тестирования на проникновение Старт: 16 мая

    Скидки до 10%

    Полный список ближайших курсов ...

Огромная просьба помочь с задачами Vba Excel

  • Автор темы Michael18
  • Дата начала
M

Michael18

Господа, завис между работой и учебой и не успел подготовиться к экзамену по VBA in Excel=(

5 простых для вас задачек вызывают у меня адские муки и бессонные ночи))

Огромная просьба помочь с решением - экзамен уже в среду и там будут практически такие же задачи:

P.S./ После каждой задачи подсказка:

QUESTION 1
Write a VBA sub-procedure that prompts the user to enter two different integer values,
finds the minimum and maximum and prints them out on excel as the minimum and
maximum.

Input: 2 10
Output:
Min 2
Max 10

QUESTION 2
Write a VBA sub-procedure that generates 100 random numbers in the range 1 to 5, finds
the frequency of occurrence of each number (1 to 5) and prints out the numbers and their
frequency of occurrence.

Processing message: 100 numbers in range 1 to 5 generated.
Output:
Range values Occurrence Frequency

1 23
2 21
3 14
4 25
5 17


QUESTION 3
Write a VBA function that receives an object of type range, sums all the elements of that
range and prints the result out on excel. You have to create the data first in excel, then
through this VBA function do the summation. The data on the ‘numbers’ column could
be non continues, whenever a number is followed by an empty cell, the empty cell is
assumed to have a value of 0.
Processing message: All elements of range summed
Output:
Numbers
0.2
0.2
3.4
1.5
1.8
4.2
Sum: 11.3

QUESTION 4
Consider the following data on excel(which you have to create in excel):
Numbers
0.2
0.2
3.4
1.5
1.8
4.2
Write a VBA program (a sub-routine “Main”, functions “Scan” and “Fill”. The first
function scans through the selection, finds the empty spots and then the “Fill” function
fills them with a numerical value which is passed through the signature of the “Fill
function.

Processing message: Scanned the range, found two empty cells in this selection and filled
them up with 0’s.
Output:
Numbers
0.2
0.2
3.4
0
1.5
1.8
0.0
4.2

QUESTION 5

Write a VBA function called MyFV(pmt, i, n) that receives amount per year (cash flow
invested per year), the earning rate, and the number of years, it should then compute the
total amount earned after the time specified.

Hint: The actual mathematical formula should be ( )
fv=pmt*(((1=i)^n-1)/i)

Scenario:
If you invest £1,000 each year at 8%, how much would you have after 3 years?
Ans: £3246.40

Большое спасибо! ;)
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!