jimrward
Well-known Member
- Joined
- Feb 24, 2003
- Messages
- 1,897
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- 2003 or older
- Platform
- Windows
in simple terms I want to achieve the following using INPUTBOX
workbook has 2 sheets, sheet1 and sheet2
I wish to select a cell in sheet2, run a macro to prompt for a source cell, use the address of the source cell to create a simple reference
for example I select sheet2!A6 and I wish to set the formula to =sheet1!A3, where Sheet1!A3 is prompted for using INPUTBOX(...type=8)
I keep getting various object errors, this is the current state of play
workbook has 2 sheets, sheet1 and sheet2
I wish to select a cell in sheet2, run a macro to prompt for a source cell, use the address of the source cell to create a simple reference
for example I select sheet2!A6 and I wish to set the formula to =sheet1!A3, where Sheet1!A3 is prompted for using INPUTBOX(...type=8)
I keep getting various object errors, this is the current state of play
Code:
Sub TestInputBox2()
Dim myRange As Range
Set myRange = Application.InputBox(Prompt:= _
"Please Select a Range", _
Title:="InputBox Method", Type:=8)
If myRange Is Nothing Then
' Range is blank
Else
ActiveCell.Formula = "=" & myRange
End If
End Sub