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!
Copyright © 2024 Q2A.ES - All rights reserved.
Answers & Comments
Verified answer
if you're just looking to insert a formula in the b column when column a is changed you can use the following code in the worksheet change event...just change the range "A1:A10" to what you need it to be:
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case MsgBox("yada yada yada", vbYesNo, "yadayada")
Case vbYes
Target.Offset(0, 1).Formula = "your formula"
Case vbNo
Target.Offset(0, 1).Formula = "your adjusted formula"
End Select
End If