May 2021 1 71 Report
Insert an Excel function into a msgbox?

Ok! Here's my problem...

In Exel I've linked one cell with another, so when the user inserts data in Cell A1 some data is automatically filled in Cell B1. I want then a message box to popup asking the user which data he wants to insert into Cell B1. I have gone as far as displaying the message box, but then I'm stuck. Is there a way to automatically fill the cells depending on the user's answer?

This is as far as I have gone with the message box.

Sub MessageBox ()

Dim strResponse as String

strResponse=MsgBox("Dei i pelatis?", vbYesNo, "Dei/Pelatis")

SelectCase strResponse

Case vbYes

(here is where I want a fuction that fills a range of cell with the following formula "=if(iserror(vlookup...." and the formula continues.. the range of cells is B5506 to B6615)

Case Else

(as with the Yes, except some minor changes in the formula)

End Select

End Sub

So... any ideas would be really life saving!

Thanks!

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.