VBA Problem

Lochnagar

New Member
Joined
Jan 28, 2008
Messages
43
Hi,

I have another VBA problem that I was hoping someone might be able to help out with. Basically, I need to stop the macros that I've written mid-way and prompt the user to select the next cell that the macros is to continue from. I appreciate that I could just use Activecell.offset(...), but the position of the cell that I want it to offset to is not fixed i.e. its user specified. I've tried using a Msgbox, which does stop the macros, but won't let me click on the spreadsheet.

Any help/suggestions would be very much appreciated

Thanks in advance,

Lochnagar
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Sub Test()
Dim MyRange As Range
Set MyRange = Application.InputBox("Select a range.", "Range Input", Type:=8)
MyRange.Select
End Sub
 
Upvote 0
Similar to Jim's but with an error check (in case user clicks Cancel for example).

Code:
Sub SelCell()
Dim r As Range
On Error Resume Next
Set r = Application.InputBox("Click in the next cell", Type:=8)
On Error GoTo 0
If r Is Nothing Then Exit Sub
Application.Goto reference:=r
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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
Back
Top