VBA Project creating a subroutine for activcell

0 votes

A subroutine named AddNumbersB should be created that prompts the user for a number, adds it to the value in the active cell, and then enters the result in a cell that is three rows and two columns to the right of the active cell.

So Far I did:

Sub AddNumbersB()
    Dim x As Double
    x = InputBox("Please enter a number")
    ActiveCell.Offset(-3, 2).Value = x

There is still something wrong. I am not sure if I missed anything.

Feb 9, 2023 in Others by Kithuzzz
• 38,010 points
643 views

1 answer to this question.

0 votes

You have to increase ActiveCell's value by that amount, x. You currently just write the value x, so change:

ActiveCell.Offset(-3, 2).Value = ActiveCell.Value + x
answered Feb 9, 2023 by narikkadan
• 63,420 points

Related Questions In Others

0 votes
1 answer

How to increment the Range of a For Each loop - Excel VBA

Your formula seems to sum 1 single ...READ MORE

answered Jan 7, 2023 in Others by narikkadan
• 63,420 points
1,976 views
0 votes
1 answer
0 votes
1 answer

VBA code for dragging down contents of a cell

Change this ActiveCell.Offset(k + 7, 0).AutoFill Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(2, ...READ MORE

answered Jan 9, 2023 in Others by narikkadan
• 63,420 points
906 views
0 votes
1 answer
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,740 points
836 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
3,138 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9, 2022 in Others by gaurav
• 23,260 points
433 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16, 2022 in Others by Edureka
• 13,670 points
698 views
0 votes
1 answer

Creating a chart in VBA with 2 different Types

Can you carry this out by hand ...READ MORE

answered Oct 11, 2022 in Others by narikkadan
• 63,420 points
240 views
0 votes
1 answer

Creating a function in excel VBA to calculate the average point in a circular set of numbers

I used the following code to determine ...READ MORE

answered Oct 28, 2022 in Others by narikkadan
• 63,420 points
777 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP