abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,507
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
i need the code it shows the data from a2:e of course dynamic on msgbox based on condition in column e is date if e=date+10 then show the data relating this date
i try with this code but not dynamic it's specific range and i stuck how i write the condition more over this code shows all of data
i need the code it shows the data from a2:e of course dynamic on msgbox based on condition in column e is date if e=date+10 then show the data relating this date
i try with this code but not dynamic it's specific range and i stuck how i write the condition more over this code shows all of data
VBA Code:
Sub mesage()
Dim xRg As Range
Dim xTxt As String
Dim xCell As Range
Dim xStr As String
Dim xRow As Long
Dim xCol As Long
On Error Resume Next
If ActiveWindow.RangeSelection.Count > 1 Then
xTxt = ActiveWindow.RangeSelection.AddressLocal
Else
xTxt = ActiveSheet.UsedRange.AddressLocal
End If
Set xRg = Range("a2:e10")
If xRg Is Nothing Then Exit Sub
On Error Resume Next
For xRow = 1 To xRg.Rows.Count
For xCol = 1 To xRg.Columns.Count
xStr = xStr & xRg.Cells(xRow, xCol).Value & vbTab
Next
xStr = xStr & vbCrLf
Next
MsgBox xStr, vbInformation, "xrg"
End Sub