Sravanth42
Sravanth42

Reputation: 11

Edit excel sheet manually while running a code

I would like to know if i can fill in a row of values manually during the run of a code when a msgbox is displayed by the code asking me to fill the same. I tried filling them but after i press 'ok' on the message box, the code continues to run and also, i cant edit the file without pressing ok on the message box. So, could anyone tell me if there is a way I can do that? Thanks in advance!

Upvotes: 1

Views: 1488

Answers (2)

Sravanth42
Sravanth42

Reputation: 11

I found 'ontime' command on the net.. I think the code can be split into 2 parts and ontime function can be used..

Upvotes: 0

MiVoth
MiVoth

Reputation: 1012

You could try to use a userform instead of an messagebox. As far as i know there is no simple way to create a messagebox, where you can edit the sheet in background.

If i need to edit the sheet while having an active macro, i'm using a userform. (they are not that hard insert in vba, try it!)

You have to start the userform with the vbmodeless. Should look like this: (i'm not 100% sure, because i've no vba ide herere to test, but i thinks it's something like this)

Sub ShowMyCreatedUserform()
    myUserform.Show vbModeless 
End Sub

If this userform is open, your code stops, but you can edit the sheets. After pressing a button (for example "ok"-button) you can continue the macro.

Upvotes: 2

Related Questions