PC Review


Reply
Thread Tools Rate Thread

Column values

 
 
marc747@excite.com
Guest
Posts: n/a
 
      9th Jul 2008


Hi,
I have a worksheet that very 3 columns are grouped, they are not
merged but every 3 columns are related. example it starts from column
(D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
will look into the first column example (D9) and see;
if (D9) is = to the number in (F9) then Delete the Values in (E9) and
(F9)
if (D9) is < to the number in (F9) then enter "of" on (E9)
and if (D9) is (empty, no value) then Delete the Values in (E9) and
(F9)
and then move to the next row in that columns all the way from
(D971)
after it is done then next group (G,H,I) (G9)

the Sheet is (Active Sheet)
the Cells are from D9:IL71

I would appreciate if anyone can help me with this.
Thank You
 
Reply With Quote
 
 
 
 
JR Form
Guest
Posts: n/a
 
      9th Jul 2008
Marc,
Are there any empty (no data) cloumns between the sets of three?

"(E-Mail Removed)" wrote:

>
>
> Hi,
> I have a worksheet that very 3 columns are grouped, they are not
> merged but every 3 columns are related. example it starts from column
> (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> will look into the first column example (D9) and see;
> if (D9) is = to the number in (F9) then Delete the Values in (E9) and
> (F9)
> if (D9) is < to the number in (F9) then enter "of" on (E9)
> and if (D9) is (empty, no value) then Delete the Values in (E9) and
> (F9)
> and then move to the next row in that columns all the way from
> (D971)
> after it is done then next group (G,H,I) (G9)
>
> the Sheet is (Active Sheet)
> the Cells are from D9:IL71
>
> I would appreciate if anyone can help me with this.
> Thank You
>

 
Reply With Quote
 
marc747@excite.com
Guest
Posts: n/a
 
      9th Jul 2008
Hi,
No empty cloumns between the sets of three.

Thanks.



On Jul 9, 11:53*am, JR Form <JRF...@discussions.microsoft.com> wrote:
> Marc,
> Are there any empty (no data) cloumns between the sets of three?
>
>
>
> "marc...@excite.com" wrote:
>
> > Hi,
> > I have a worksheet that very 3 columns are grouped, they are not
> > merged but every 3 columns are related. example it starts from column
> > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > will look into the first column example (D9) and see;
> > if (D9) is = to the number in (F9) then Delete the Values in (E9) and
> > (F9)
> > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > and if (D9) is (empty, no value) then Delete the Values in (E9) and
> > (F9)
> > and then move to the next row in that columns all the way from
> > (D971)
> > after it is done then next group (G,H,I) (G9)

>
> > the Sheet is (Active Sheet)
> > the Cells are from D9:IL71

>
> > I would appreciate if anyone can help me with this.
> > Thank You- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
JR Form
Guest
Posts: n/a
 
      10th Jul 2008
marc,

Try this code:
first copy the worksheet and try it out on the copy.
'**********************************************
Sub DoMyRowsColumns()
Dim i, k As Integer
Range("d9").Select
Application.ScreenUpdating = False
k = 0
Do Until k = 80
i = 0

Do Until i = 62

If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
ActiveCell.Offset(0, 1).ClearContents
ActiveCell.Offset(0, 2).ClearContents
Else
If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
ActiveCell.Offset(0, 1) = "OF"
Else
ActiveCell.Offset(0, 0).ClearContents
ActiveCell.Offset(0, 1).ClearContents
ActiveCell.Offset(0, 2).ClearContents
End If
End If
ActiveCell.Offset(1, 0).Select
i = i + 1
Loop

ActiveCell.Offset(-i, 3).Select '-i sends it back to the top of the next
column

k = k + 1

Loop
Application.ScreenUpdating = True
End Sub

'************************************8

"(E-Mail Removed)" wrote:

> Hi,
> No empty cloumns between the sets of three.
>
> Thanks.
>
>
>
> On Jul 9, 11:53 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > Marc,
> > Are there any empty (no data) cloumns between the sets of three?
> >
> >
> >
> > "marc...@excite.com" wrote:
> >
> > > Hi,
> > > I have a worksheet that very 3 columns are grouped, they are not
> > > merged but every 3 columns are related. example it starts from column
> > > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > > will look into the first column example (D9) and see;
> > > if (D9) is = to the number in (F9) then Delete the Values in (E9) and
> > > (F9)
> > > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > > and if (D9) is (empty, no value) then Delete the Values in (E9) and
> > > (F9)
> > > and then move to the next row in that columns all the way from
> > > (D971)
> > > after it is done then next group (G,H,I) (G9)

> >
> > > the Sheet is (Active Sheet)
> > > the Cells are from D9:IL71

> >
> > > I would appreciate if anyone can help me with this.
> > > Thank You- Hide quoted text -

> >
> > - Show quoted text -

>
>

 
Reply With Quote
 
marc747@excite.com
Guest
Posts: n/a
 
      11th Jul 2008
Hi, thanks for your help, it works but we need to refine it a little.

I belive this is the part that enters the "OF" if so then I need to
add a line.

If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
ActiveCell.Offset(0, 1) = "of"

I am trying to add a two requirement in order to enter an "OF"
[if (D9) is < to the number in (F9)] and [(D9) is >=1] if both
requirements are ok! then enter "of" on (E9) ]

And at no point (D9) gets cleared.
And if (D9) has no value in it then (E9 and F9) should be cleared

Thanks you so much....








On Jul 10, 12:15*pm, JR Form <JRF...@discussions.microsoft.com> wrote:
> marc,
>
> Try this code:
> first copy the worksheet and try it out on the copy.
> '**********************************************
> Sub DoMyRowsColumns()
> Dim i, k As Integer
> Range("d9").Select
> Application.ScreenUpdating = False
> k = 0
> * Do Until k = 80
> * * *i = 0
>
> * * Do Until i = 62
>
> * * * If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> * * * * ActiveCell.Offset(0, 1).ClearContents
> * * * * ActiveCell.Offset(0, 2).ClearContents
> * * * Else
> * * * * * If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> * * * * * * ActiveCell.Offset(0, 1) = "OF"
> * * * * * Else
> * * * * * * ActiveCell.Offset(0, 0).ClearContents
> * * * * * * ActiveCell.Offset(0, 1).ClearContents
> * * * * * * ActiveCell.Offset(0, 2).ClearContents
> * * * * * End If
> * * * End If
> * * * ActiveCell.Offset(1, 0).Select
> * * * i = i + 1
> * * Loop
>
> * ActiveCell.Offset(-i, 3).Select *'-i sends it back to the top of the next
> column
>
> * k = k + 1
>
> Loop
> Application.ScreenUpdating = True
> End Sub
>
> '************************************8
>
>
>
> "marc...@excite.com" wrote:
> > Hi,
> > No empty cloumns between the sets of three.

>
> > Thanks.

>
> > On Jul 9, 11:53 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > Marc,
> > > Are there any empty (no data) cloumns between the sets of three?

>
> > > "marc...@excite.com" wrote:

>
> > > > Hi,
> > > > I have a worksheet that very 3 columns are grouped, they are not
> > > > merged but every 3 columns are related. example it starts from column
> > > > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > > > will look into the first column example (D9) and see;
> > > > if (D9) is = to the number in (F9) then Delete the Values in (E9)and
> > > > (F9)
> > > > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > > > and if (D9) is (empty, no value) then Delete the Values in (E9) and
> > > > (F9)
> > > > and then move to the next row in that columns all the way from
> > > > (D971)
> > > > after it is done then next group (G,H,I) (G9)

>
> > > > the Sheet is (Active Sheet)
> > > > the Cells are from D9:IL71

>
> > > > I would appreciate if anyone can help me with this.
> > > > Thank You- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
marc747@excite.com
Guest
Posts: n/a
 
      11th Jul 2008
Hi, thanks for your help, it works but we need to refine it a little.

I belive below is the part that enters the "OF" if so then I need to
add a line.

If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
ActiveCell.Offset(0, 1) = "of"

I am trying to add a two requirement in order to enter an "OF"
[if (D9) is < to the number in (F9)] and [(D9) is >=1] if both
requirements are ok! then enter "OF" in (E9) ]

And at no point (D9) gets cleared.
And if (D9) has no value in it then (E9 and F9) should be cleared

Also is it possible to enter a short text next to the code so that I
can understand which code does what.

Thanks you so much....





On Jul 10, 12:15*pm, JR Form <JRF...@discussions.microsoft.com> wrote:
> marc,
>
> Try this code:
> first copy the worksheet and try it out on the copy.
> '**********************************************
> Sub DoMyRowsColumns()
> Dim i, k As Integer
> Range("d9").Select
> Application.ScreenUpdating = False
> k = 0
> * Do Until k = 80
> * * *i = 0
>
> * * Do Until i = 62
>
> * * * If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> * * * * ActiveCell.Offset(0, 1).ClearContents
> * * * * ActiveCell.Offset(0, 2).ClearContents
> * * * Else
> * * * * * If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> * * * * * * ActiveCell.Offset(0, 1) = "OF"
> * * * * * Else
> * * * * * * ActiveCell.Offset(0, 0).ClearContents
> * * * * * * ActiveCell.Offset(0, 1).ClearContents
> * * * * * * ActiveCell.Offset(0, 2).ClearContents
> * * * * * End If
> * * * End If
> * * * ActiveCell.Offset(1, 0).Select
> * * * i = i + 1
> * * Loop
>
> * ActiveCell.Offset(-i, 3).Select *'-i sends it back to the top of the next
> column
>
> * k = k + 1
>
> Loop
> Application.ScreenUpdating = True
> End Sub
>
> '************************************8
>
>
>
> "marc...@excite.com" wrote:
> > Hi,
> > No empty cloumns between the sets of three.

>
> > Thanks.

>
> > On Jul 9, 11:53 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > Marc,
> > > Are there any empty (no data) cloumns between the sets of three?

>
> > > "marc...@excite.com" wrote:

>
> > > > Hi,
> > > > I have a worksheet that very 3 columns are grouped, they are not
> > > > merged but every 3 columns are related. example it starts from column
> > > > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > > > will look into the first column example (D9) and see;
> > > > if (D9) is = to the number in (F9) then Delete the Values in (E9)and
> > > > (F9)
> > > > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > > > and if (D9) is (empty, no value) then Delete the Values in (E9) and
> > > > (F9)
> > > > and then move to the next row in that columns all the way from
> > > > (D971)
> > > > after it is done then next group (G,H,I) (G9)

>
> > > > the Sheet is (Active Sheet)
> > > > the Cells are from D9:IL71

>
> > > > I would appreciate if anyone can help me with this.
> > > > Thank You- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
JR Form
Guest
Posts: n/a
 
      11th Jul 2008
marc,

Here it again with the changes

'**********************************
Sub DoMyRowsColumns()
Dim i, k As Integer
Range("d9").Select
Application.ScreenUpdating = False
k = 0
Do Until k = 80
i = 0

Do Until i = 62

If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
ActiveCell.Offset(0, 1).ClearContents
ActiveCell.Offset(0, 2).ClearContents
Else
If ((ActiveCell.Value < ActiveCell.Offset(0, 2).Value) And _
(ActiveCell.Value <= 1)) Then 'new requirement
ActiveCell.Offset(0, 1) = "OF"
Else
ActiveCell.Offset(0, 0).ClearContents
ActiveCell.Offset(0, 1).ClearContents
ActiveCell.Offset(0, 2).ClearContents
End If
End If
ActiveCell.Offset(1, 0).Select
i = i + 1
Loop

ActiveCell.Offset(-i, 3).Select '-i sends it back to the top of the next
column

k = k + 1

Loop
Application.ScreenUpdating = True
End Sub

'**********************************

"(E-Mail Removed)" wrote:

> Hi, thanks for your help, it works but we need to refine it a little.
>
> I belive below is the part that enters the "OF" if so then I need to
> add a line.
>
> If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> ActiveCell.Offset(0, 1) = "of"
>
> I am trying to add a two requirement in order to enter an "OF"
> [if (D9) is < to the number in (F9)] and [(D9) is >=1] if both
> requirements are ok! then enter "OF" in (E9) ]
>
> And at no point (D9) gets cleared.
> And if (D9) has no value in it then (E9 and F9) should be cleared
>
> Also is it possible to enter a short text next to the code so that I
> can understand which code does what.
>
> Thanks you so much....
>
>
>
>
>
> On Jul 10, 12:15 pm, JR Form <JRF...@discussions.microsoft.com> wrote:
> > marc,
> >
> > Try this code:
> > first copy the worksheet and try it out on the copy.
> > '**********************************************
> > Sub DoMyRowsColumns()
> > Dim i, k As Integer
> > Range("d9").Select
> > Application.ScreenUpdating = False
> > k = 0
> > Do Until k = 80
> > i = 0
> >
> > Do Until i = 62
> >
> > If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> > ActiveCell.Offset(0, 1).ClearContents
> > ActiveCell.Offset(0, 2).ClearContents
> > Else
> > If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> > ActiveCell.Offset(0, 1) = "OF"
> > Else
> > ActiveCell.Offset(0, 0).ClearContents
> > ActiveCell.Offset(0, 1).ClearContents
> > ActiveCell.Offset(0, 2).ClearContents
> > End If
> > End If
> > ActiveCell.Offset(1, 0).Select
> > i = i + 1
> > Loop
> >
> > ActiveCell.Offset(-i, 3).Select '-i sends it back to the top of the next
> > column
> >
> > k = k + 1
> >
> > Loop
> > Application.ScreenUpdating = True
> > End Sub
> >
> > '************************************8
> >
> >
> >
> > "marc...@excite.com" wrote:
> > > Hi,
> > > No empty cloumns between the sets of three.

> >
> > > Thanks.

> >
> > > On Jul 9, 11:53 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > > Marc,
> > > > Are there any empty (no data) cloumns between the sets of three?

> >
> > > > "marc...@excite.com" wrote:

> >
> > > > > Hi,
> > > > > I have a worksheet that very 3 columns are grouped, they are not
> > > > > merged but every 3 columns are related. example it starts from column
> > > > > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > > > > will look into the first column example (D9) and see;
> > > > > if (D9) is = to the number in (F9) then Delete the Values in (E9) and
> > > > > (F9)
> > > > > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > > > > and if (D9) is (empty, no value) then Delete the Values in (E9) and
> > > > > (F9)
> > > > > and then move to the next row in that columns all the way from
> > > > > (D971)
> > > > > after it is done then next group (G,H,I) (G9)

> >
> > > > > the Sheet is (Active Sheet)
> > > > > the Cells are from D9:IL71

> >
> > > > > I would appreciate if anyone can help me with this.
> > > > > Thank You- Hide quoted text -

> >
> > > > - Show quoted text -- Hide quoted text -

> >
> > - Show quoted text -

>
>

 
Reply With Quote
 
marc747@excite.com
Guest
Posts: n/a
 
      18th Jul 2008
Thanks, it worked great.
I have one more question, for this Macro we have a set of 3 Columns
grouped, how would I change the Macro to make it a set of 4 Columns
grouped
I appreciate your help..... thanks!







On Jul 11, 5:30*am, JR Form <JRF...@discussions.microsoft.com> wrote:
> marc,
>
> Here it again with the changes
>
> '**********************************
> Sub DoMyRowsColumns()
> Dim i, k As Integer
> Range("d9").Select
> Application.ScreenUpdating = False
> k = 0
> * Do Until k = 80
> * * *i = 0
>
> * * Do Until i = 62
>
> * * * If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> * * * * ActiveCell.Offset(0, 1).ClearContents
> * * * * ActiveCell.Offset(0, 2).ClearContents
> * * * Else
> * * * * * If ((ActiveCell.Value < ActiveCell.Offset(0, 2).Value) And _
> * * * * * * * (ActiveCell.Value <= 1)) Then *'new requirement
> * * * * * * ActiveCell.Offset(0, 1) = "OF"
> * * * * * Else
> * * * * * * ActiveCell.Offset(0, 0).ClearContents
> * * * * * * ActiveCell.Offset(0, 1).ClearContents
> * * * * * * ActiveCell.Offset(0, 2).ClearContents
> * * * * * End If
> * * * End If
> * * * ActiveCell.Offset(1, 0).Select
> * * * i = i + 1
> * * Loop
>
> * ActiveCell.Offset(-i, 3).Select *'-i sends it back to the top of the next
> column
>
> * k = k + 1
>
> Loop
> Application.ScreenUpdating = True
> End Sub
>
> '**********************************
>
>
>
> "marc...@excite.com" wrote:
> > Hi, thanks for your help, it works but we need to refine it a little.

>
> > I belive below is the part that enters the "OF" if so then I need to
> > add a line.

>
> > * * * * * * If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> > * * * * * * * * * * *ActiveCell.Offset(0, 1) = "of"

>
> > I am trying to add a two requirement in order to enter an "OF"
> > *[if (D9) is < to the number in (F9)] *and *[(D9) is >=1] if both
> > requirements are ok! then enter "OF" in (E9) ]

>
> > And at no point (D9) gets cleared.
> > And if (D9) has no value in it then (E9 and F9) should be cleared

>
> > Also is it possible to enter a short text next to the code so that I
> > can understand which code does what.

>
> > Thanks you so much....

>
> > On Jul 10, 12:15 pm, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > marc,

>
> > > Try this code:
> > > first copy the worksheet and try it out on the copy.
> > > '**********************************************
> > > Sub DoMyRowsColumns()
> > > Dim i, k As Integer
> > > Range("d9").Select
> > > Application.ScreenUpdating = False
> > > k = 0
> > > * Do Until k = 80
> > > * * *i = 0

>
> > > * * Do Until i = 62

>
> > > * * * If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> > > * * * * ActiveCell.Offset(0, 1).ClearContents
> > > * * * * ActiveCell.Offset(0, 2).ClearContents
> > > * * * Else
> > > * * * * * If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> > > * * * * * * ActiveCell.Offset(0, 1) = "OF"
> > > * * * * * Else
> > > * * * * * * ActiveCell.Offset(0, 0).ClearContents
> > > * * * * * * ActiveCell.Offset(0, 1).ClearContents
> > > * * * * * * ActiveCell.Offset(0, 2).ClearContents
> > > * * * * * End If
> > > * * * End If
> > > * * * ActiveCell.Offset(1, 0).Select
> > > * * * i = i + 1
> > > * * Loop

>
> > > * ActiveCell.Offset(-i, 3).Select *'-i sends it back to the top of the next
> > > column

>
> > > * k = k + 1

>
> > > Loop
> > > Application.ScreenUpdating = True
> > > End Sub

>
> > > '************************************8

>
> > > "marc...@excite.com" wrote:
> > > > Hi,
> > > > No empty cloumns between the sets of three.

>
> > > > Thanks.

>
> > > > On Jul 9, 11:53 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > > > Marc,
> > > > > Are there any empty (no data) cloumns between the sets of three?

>
> > > > > "marc...@excite.com" wrote:

>
> > > > > > Hi,
> > > > > > I have a worksheet that very 3 columns are grouped, they are not
> > > > > > merged but every 3 columns are related. example it starts from column
> > > > > > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > > > > > will look into the first column example (D9) and see;
> > > > > > if (D9) is = to the number in (F9) then Delete the Values in (E9) and
> > > > > > (F9)
> > > > > > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > > > > > and if (D9) is (empty, no value) then Delete the Values in (E9)and
> > > > > > (F9)
> > > > > > and then move to the next row in that columns all the way from
> > > > > > (D971)
> > > > > > after it is done then next group (G,H,I) (G9)

>
> > > > > > the Sheet is (Active Sheet)
> > > > > > the Cells are from D9:IL71

>
> > > > > > I would appreciate if anyone can help me with this.
> > > > > > Thank You- Hide quoted text -

>
> > > > > - Show quoted text -- Hide quoted text -

>
> > > - Show quoted text -- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
JR Form
Guest
Posts: n/a
 
      18th Jul 2008
marc,

Are you doing an evaluation on the 4th column? You would need to add some
code to make it do the evaluation and clear contents if that is what you
wanted. Also change the offset to 4 from 3 so it moves 4 columns at a time.


Here it again with the changes

'**********************************
Sub DoMyRowsColumns()
Dim i, k As Integer
Range("d9").Select
Application.ScreenUpdating = False
k = 0
Do Until k = 80
i = 0

Do Until i = 62

If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
ActiveCell.Offset(0, 1).ClearContents
ActiveCell.Offset(0, 2).ClearContents
ActiveCell.Offset(0, 3).ClearContents '4th column

Else
If ((ActiveCell.Value < ActiveCell.Offset(0, 2).Value) And _
(ActiveCell.Value <= 1)) Then 'new requirement
ActiveCell.Offset(0, 1) = "OF"
Else
ActiveCell.Offset(0, 0).ClearContents
ActiveCell.Offset(0, 1).ClearContents
ActiveCell.Offset(0, 2).ClearContents
ActiveCell.Offset(0, 3).ClearContents '4th column

End If
End If
ActiveCell.Offset(1, 0).Select
i = i + 1
Loop
'below changed for 4th column request
ActiveCell.Offset(-i, 4).Select '-i sends it back to the top of the next
column

k = k + 1

Loop
Application.ScreenUpdating = True
End Sub

'**********************************


"(E-Mail Removed)" wrote:

> Thanks, it worked great.
> I have one more question, for this Macro we have a set of 3 Columns
> grouped, how would I change the Macro to make it a set of 4 Columns
> grouped
> I appreciate your help..... thanks!
>
>
>
>
>
>
>
> On Jul 11, 5:30 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > marc,
> >
> > Here it again with the changes
> >
> > '**********************************
> > Sub DoMyRowsColumns()
> > Dim i, k As Integer
> > Range("d9").Select
> > Application.ScreenUpdating = False
> > k = 0
> > Do Until k = 80
> > i = 0
> >
> > Do Until i = 62
> >
> > If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> > ActiveCell.Offset(0, 1).ClearContents
> > ActiveCell.Offset(0, 2).ClearContents
> > Else
> > If ((ActiveCell.Value < ActiveCell.Offset(0, 2).Value) And _
> > (ActiveCell.Value <= 1)) Then 'new requirement
> > ActiveCell.Offset(0, 1) = "OF"
> > Else
> > ActiveCell.Offset(0, 0).ClearContents
> > ActiveCell.Offset(0, 1).ClearContents
> > ActiveCell.Offset(0, 2).ClearContents
> > End If
> > End If
> > ActiveCell.Offset(1, 0).Select
> > i = i + 1
> > Loop
> >
> > ActiveCell.Offset(-i, 3).Select '-i sends it back to the top of the next
> > column
> >
> > k = k + 1
> >
> > Loop
> > Application.ScreenUpdating = True
> > End Sub
> >
> > '**********************************
> >
> >
> >
> > "marc...@excite.com" wrote:
> > > Hi, thanks for your help, it works but we need to refine it a little.

> >
> > > I belive below is the part that enters the "OF" if so then I need to
> > > add a line.

> >
> > > If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> > > ActiveCell.Offset(0, 1) = "of"

> >
> > > I am trying to add a two requirement in order to enter an "OF"
> > > [if (D9) is < to the number in (F9)] and [(D9) is >=1] if both
> > > requirements are ok! then enter "OF" in (E9) ]

> >
> > > And at no point (D9) gets cleared.
> > > And if (D9) has no value in it then (E9 and F9) should be cleared

> >
> > > Also is it possible to enter a short text next to the code so that I
> > > can understand which code does what.

> >
> > > Thanks you so much....

> >
> > > On Jul 10, 12:15 pm, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > > marc,

> >
> > > > Try this code:
> > > > first copy the worksheet and try it out on the copy.
> > > > '**********************************************
> > > > Sub DoMyRowsColumns()
> > > > Dim i, k As Integer
> > > > Range("d9").Select
> > > > Application.ScreenUpdating = False
> > > > k = 0
> > > > Do Until k = 80
> > > > i = 0

> >
> > > > Do Until i = 62

> >
> > > > If ActiveCell.Value = ActiveCell.Offset(0, 2).Value Then
> > > > ActiveCell.Offset(0, 1).ClearContents
> > > > ActiveCell.Offset(0, 2).ClearContents
> > > > Else
> > > > If ActiveCell.Value < ActiveCell.Offset(0, 2).Value Then
> > > > ActiveCell.Offset(0, 1) = "OF"
> > > > Else
> > > > ActiveCell.Offset(0, 0).ClearContents
> > > > ActiveCell.Offset(0, 1).ClearContents
> > > > ActiveCell.Offset(0, 2).ClearContents
> > > > End If
> > > > End If
> > > > ActiveCell.Offset(1, 0).Select
> > > > i = i + 1
> > > > Loop

> >
> > > > ActiveCell.Offset(-i, 3).Select '-i sends it back to the top of the next
> > > > column

> >
> > > > k = k + 1

> >
> > > > Loop
> > > > Application.ScreenUpdating = True
> > > > End Sub

> >
> > > > '************************************8

> >
> > > > "marc...@excite.com" wrote:
> > > > > Hi,
> > > > > No empty cloumns between the sets of three.

> >
> > > > > Thanks.

> >
> > > > > On Jul 9, 11:53 am, JR Form <JRF...@discussions.microsoft.com> wrote:
> > > > > > Marc,
> > > > > > Are there any empty (no data) cloumns between the sets of three?

> >
> > > > > > "marc...@excite.com" wrote:

> >
> > > > > > > Hi,
> > > > > > > I have a worksheet that very 3 columns are grouped, they are not
> > > > > > > merged but every 3 columns are related. example it starts from column
> > > > > > > (D,E,F) (G,H,I) (J,K,L) and so on. I am trying to make a macro that
> > > > > > > will look into the first column example (D9) and see;
> > > > > > > if (D9) is = to the number in (F9) then Delete the Values in (E9) and
> > > > > > > (F9)
> > > > > > > if (D9) is < to the number in (F9) then enter "of" on (E9)
> > > > > > > and if (D9) is (empty, no value) then Delete the Values in (E9) and
> > > > > > > (F9)
> > > > > > > and then move to the next row in that columns all the way from
> > > > > > > (D971)
> > > > > > > after it is done then next group (G,H,I) (G9)

> >
> > > > > > > the Sheet is (Active Sheet)
> > > > > > > the Cells are from D9:IL71

> >
> > > > > > > I would appreciate if anyone can help me with this.
> > > > > > > Thank You- Hide quoted text -

> >
> > > > > > - Show quoted text -- Hide quoted text -

> >
> > > > - Show quoted text -- Hide quoted text -

> >
> > - Show quoted text -

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autosum column values, if separate column values equal certain val Hulqscout Microsoft Excel Worksheet Functions 1 5th Nov 2008 06:37 PM
Search for a value in column A and return the vaule/values in column B to column C minismood Microsoft Excel Discussion 3 10th Jan 2006 10:02 AM
Summing visible column values but not hidden column values =?Utf-8?B?Qlc=?= Microsoft Excel Misc 2 2nd Nov 2004 06:32 PM
Count of values in a column based on values in another column student Microsoft Excel Discussion 9 19th Aug 2004 02:30 PM
Calculating values to column D with formula based on values column A spolk Microsoft Excel Programming 1 30th Apr 2004 06:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:45 AM.