PDA

View Full Version : [SOLVED:] POP UP VBA!!



helsayed
01-29-2014, 08:31 AM
Hello all! am sorry for my english. am new to VBA and would like to know the probleme with my code.
In fact i want the code to alert me by popping up the data in cell of column A when the data in cell of column D are < 45.
ITS NOT WORKING! :(....plz look and the file attached and thx a lot for your help!

westconn1
01-29-2014, 01:47 PM
try like

Sub Trouver()

Dim I
Dim Var(1 To 40)

Dim cel As Range
I = 1
For Each cel In Range("D2:D30")

If cel < 45 And Not IsEmpty(cel) Then
Var(I) = cel.Offset(, -3) & " in row " & cel.Row
I = I + 1
End If

Next cel

MsgBox Join(Var, vbNewLine)
End Sub

helsayed
01-29-2014, 11:12 PM
westconn1

Thanks a lot!!! it works perfectly!!!:clap::clap::clap::clap::clap::clap::clap:


try like

Sub Trouver()

Dim I
Dim Var(1 To 40)

Dim cel As Range
I = 1
For Each cel In Range("D2:D30")

If cel < 45 And Not IsEmpty(cel) Then
Var(I) = cel.Offset(, -3) & " in row " & cel.Row
I = I + 1
End If

Next cel

MsgBox Join(Var, vbNewLine)
End Sub

snb
01-30-2014, 03:40 AM
Please do not quote unnecessarily !

A oneliners suffices:


Sub M_snb()
MsgBox Join(Filter([transpose(if(D2:D30<45,A2:A30 & " in row " & row(D2:D30),"~"))], "~", False), vbLf)
End Sub

Paul_Hossler
01-30-2014, 07:10 AM
Please do not quote unnecessarily !

A oneliners suffices:


Sub M_snb()
MsgBox Join(Filter([transpose(if(D2:D30<45,A2:A30 & " in row " & row(D2:D30),"~"))], "~", False), vbLf)
End Sub

Unfortunately if someone just clicks [Reply With Quote], the entire message is included, and a lot of times responders (reply-ers ??) do not remember to edit out the extraneous

As I recall, the previous forum SW would only include text that was specifically selected

Paul