user3022697
user3022697

Reputation: 11

I'm trying to create 2 separate excel macros in one goal which is quite tough i know

1st Macro To go to the cell reference keyed(which is akin to F5), however I'm stuck with the following;

Public Sub Cellgoto()

Application.Goto Reference:="To be input by user"

End Sub

A Separate 2nd Macro

Purpose: Once the first macro is executed, and go to the rowcolumn that I want, or the designated cell. Then I would love to have another macro to prompt user to paste formulas over to a new text/inputbox. In turn it will pasted to the designated cell(from the first macro). This is really tough, which I'm pretty stuck..

Need angels!

Upvotes: 0

Views: 68

Answers (1)

Shiva
Shiva

Reputation: 20935

Here's your Macro. I just wrote the code and tested it and it works. Hope it helps!

Sub GotoCellAndEnterFormula()

Dim strGotoCell As String
Dim strFormula As String

    strGotoCell = InputBox("Enter a Cell Reference (ex: B10 )", "Goto Cell")

    If strGotoCell <> "" Then
        Application.Goto Reference:=Range(strGotoCell)
        strFormula = InputBox("Enter a Formula (ex: = SUM(A1,A2) )", "Formula Entry")

        If strFormula <> "" Then
            ActiveCell.Formula = strFormula
        End If

    End If

End Sub

Upvotes: 0

Related Questions