Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
This is my first attempt at writing VBA from a book so excuse the naivety. Sub Hidereconciledrows() Dim i As Integer i = 2 Do Until IsEmpty(Cells(i, 18)) If Cells(i, 18) = "Reconciles <= 7 day tolerance" Then Selection.EntireRow.Hidden = True And ActiveCell.Offset(1, 0).Select ElseIf Cells(i, 18) = "manually reconcile" Then ActiveCell.Offset(1, 0).Select End If i = i + 1 Loop End Sub I am performing a reconcilation and if a particular figure matches another the narritive "Reconciles <= 7 day tolerance" is formularised to appear in cell(?) column R if the figure does not match then the narritive "manually reconcile" is formularised to appear. What I am attempting with VBA is if the cell contains "Reconciles <= 7 day tolerance" the macro will select the entire row and hide the row, it will then select the next row down, in column R and perform the same test. When the cell in column R is blank the procedure ends. Obviosly what I have wriiten above is not working, can someone please point me in the right direction? Thanks Grant |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() instead of this Selection.EntireRow.Hidden = True And ActiveCell.Offset(1, 0).Select use Cells(i, 2).EntireRow.Hidden = True And ActiveCell.Offset(1, 0).Select - Manges -- mangesh_yada ----------------------------------------------------------------------- mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047 View this thread: http://www.excelforum.com/showthread.php?threadid=27649 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim i As Integer
i = 2 Do Until IsEmpty(Cells(i, 18)) With Cells(i, 18) If .Value = "Reconciles <= 7 day tolerance" Then .EntireRow.Hidden = True End If End With i = i + 1 Loop End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Grant" wrote in message m... Hi, This is my first attempt at writing VBA from a book so excuse the naivety. Sub Hidereconciledrows() Dim i As Integer i = 2 Do Until IsEmpty(Cells(i, 18)) If Cells(i, 18) = "Reconciles <= 7 day tolerance" Then Selection.EntireRow.Hidden = True And ActiveCell.Offset(1, 0).Select ElseIf Cells(i, 18) = "manually reconcile" Then ActiveCell.Offset(1, 0).Select End If i = i + 1 Loop End Sub I am performing a reconcilation and if a particular figure matches another the narritive "Reconciles <= 7 day tolerance" is formularised to appear in cell(?) column R if the figure does not match then the narritive "manually reconcile" is formularised to appear. What I am attempting with VBA is if the cell contains "Reconciles <= 7 day tolerance" the macro will select the entire row and hide the row, it will then select the next row down, in column R and perform the same test. When the cell in column R is blank the procedure ends. Obviosly what I have wriiten above is not working, can someone please point me in the right direction? Thanks Grant |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thankyou for your reply, it worked a treat!!
Grant "Bob Phillips" wrote in message ... Dim i As Integer i = 2 Do Until IsEmpty(Cells(i, 18)) With Cells(i, 18) If .Value = "Reconciles <= 7 day tolerance" Then .EntireRow.Hidden = True End If End With i = i + 1 Loop End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Grant" wrote in message m... Hi, This is my first attempt at writing VBA from a book so excuse the naivety. Sub Hidereconciledrows() Dim i As Integer i = 2 Do Until IsEmpty(Cells(i, 18)) If Cells(i, 18) = "Reconciles <= 7 day tolerance" Then Selection.EntireRow.Hidden = True And ActiveCell.Offset(1, 0).Select ElseIf Cells(i, 18) = "manually reconcile" Then ActiveCell.Offset(1, 0).Select End If i = i + 1 Loop End Sub I am performing a reconcilation and if a particular figure matches another the narritive "Reconciles <= 7 day tolerance" is formularised to appear in cell(?) column R if the figure does not match then the narritive "manually reconcile" is formularised to appear. What I am attempting with VBA is if the cell contains "Reconciles <= 7 day tolerance" the macro will select the entire row and hide the row, it will then select the next row down, in column R and perform the same test. When the cell in column R is blank the procedure ends. Obviosly what I have wriiten above is not working, can someone please point me in the right direction? Thanks Grant |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple IF problem | Excel Worksheet Functions | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple problem | New Users to Excel | |||
another simple problem... | Excel Worksheet Functions | |||
Need help with a simple problem | Excel Programming |