InputBox for Cell range

maguirej

New Member
Joined
Sep 9, 2002
Messages
13
:rolleyes:
This is probably easy, but I am not strong in VBA. I want to set up an InputBox for the user to enter a range of cells. I want to automate a copy / paste / value function for columns (Jan - Dec) to replace array formulas with the actuals once calculated to stop our excel 2000 from zeroing these out at times.

What is the correct syntax? I have this and it's not working:

C = InputBox("Which range to copy paste value?", "", "C24:I134")

Range.Select = C


Any advice is greatly appreciated!!!
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Example:

Code:
Sub Test()
    Dim Rng As Range
    On Error GoTo Cancelled
    Set Rng = Application.InputBox(Prompt:="Which range to copy paste value", Title:="Remove Formulas", Type:=8)
    Rng.Copy
    Rng.PasteSpecial xlPasteValues
Cancelled:
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,995
Messages
5,599,256
Members
414,299
Latest member
thenewworld

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top