Link to home
Start Free TrialLog in
Avatar of ADRIANA P
ADRIANA PFlag for United States of America

asked on

Relative and Relative count button don't work in 3N

in this 3n File the Relative dont show up all the DATA  either the relative count

29173941.xlsm.xlsm


Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Can you show me a picture of what is missing or tell me a cell that is missing a value and what that value should be?

¿Puede mostrarme una imagen de lo que falta o decirme una celda a la que le falta un valor y cuál debería ser ese valor?
Avatar of ADRIANA P

ASKER

User generated image
In the Case of the Relative work until 7W2016  when you hit the RELATIVE buttom
User generated imagein the case of the Relative Count button it work until 7W2016  after that week nothing show up
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Martin !!

Thanks like always the best !! your  patience and   for your help !! to me always is welcome here

In this situation when i hit the RELATIVE button in sheet 1  it  produce the 3 DIGIT RELATIVE  sheet
then in that sheet it produce the left side relative and the rigth side relative

from one column input the column C in sheet 1


the file 29203972.xlsm  after the adjustment is not working that way

need keep that way to track the coulmn C this

the File 29173941.xlsm.xlsm  uploaded is working good but  when you add data after week 7W2016
dont' show  more the relative data in sheet  3 DIGIT RELATIVE 

what is needed now the capacity to add data beyond 7W2016  
as time goes on



I believe that is a problem you've had before so
  1. Add this sub to a module
  2. Add your new data
  3. Run the sub

OR

Do #2 and post that workbook and I'll fix it.


Sub ConvertStringDateToDate()
    Dim lngRow As Long
    Dim strParts() As String
    Dim intYear As Integer
    Dim intMonth As Integer
    Dim intDay As Integer
    Dim arrMonthNames As Variant
    Dim intMonthName As Integer
    Dim strCellValue As String
    Dim lngLastRow As Long
    Dim lngSourceRow As Long
    
    lngLastRow = Range("A1048576").End(xlUp).Row

    Application.ScreenUpdating = False
    
    Columns("A:A").NumberFormat = "[$-F800]dddd, mmmm dd, yyyy"

    arrMonthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
    
    For lngSourceRow = 1 To lngLastRow
        If InStr(Cells(lngSourceRow, "A"), "W20") Then
            lngSourceRow = lngSourceRow + 1
            Exit For
        End If
    Next
        
    For lngRow = 1 To lngLastRow
        If Len(Cells(lngRow, "A")) > 10 And InStr(Cells(lngRow, "A").Text, ", 20") > 0 Then
            strCellValue = Cells(lngRow, "A")
            strParts = Split(strCellValue, ", ")
            intYear = CInt(strParts(2))
            
            For intMonthName = 0 To 11
                If arrMonthNames(intMonthName) = Split(strParts(1), " ")(0) Then
                    intMonth = intMonthName + 1
                    Exit For
                End If
            Next
            
            intDay = Split(strParts(1), " ")(1)
            Cells(lngRow, "A") = DateSerial(strParts(2), intMonth, intDay)
            Range("A" & lngSourceRow).Copy
            Cells(lngRow, "A").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
            SkipBlanks:=False, Transpose:=False
        End If
    Next
    
    Application.ScreenUpdating = True

End Sub

Open in new window

Martin !  You have an great memory
you don't forget anything 

 Best Expert I added in file 29173941.xlsm.xlsm data beyond  7W2016   
i added data to december 2020 
Does it work now?
i don't know how work with you code


Add the new data to the workbook and attach it here.

Agregue los nuevos datos al libro de trabajo y adjúntelos aquí.
Martin the data is already add

until December 2020 in file

29173941.xlsm.xlsm data beyond  7W2016    

but the data goes in sheet 1 column C then when you hit the RELATIVE button it create the 3 DIGIT RELATIVE  sheet
that shows up the LEFT AND RIGTH SIDE of RELATIVES
I don't remember:) What should it show?
Martin !

1-data is in column C sheet 1  (input)

2-then  hit the Relative button

3-then it create the  3 DIGIT RELATIVE  sheet 

4- Data in  3 DIGIT RELATIVE  sheet  should have the same  data (input) as column C
and shows LEFT side and Rigth Side of Relatives



It looks to me like it does. If not then please tell me what is wrong.

User generated image
Martin !!

The after hit the Relative Button

it worked great until week 7w2016

i did not shows the RELATIVES after week 7w2016  as should be in 3 DIGIT RELATIVE  sheet  
Look at my picture it show part of 8W2016. If yours doesn't then please post the workbook you are using.

Mira mi foto, muestra parte del 8W2016. Si el suyo no lo hace, publique el libro de trabajo que está utilizando.
Martin !

ok I see

you see data as your pic but that Data is wrong (after you adjustment)

Why?

because the left side is not the same as the rigth side

see pic here

User generated image


you did an adjustment to show data after 7w2016
but it shows the LEFT side and Rigrh Side the Same.

the fix should keep the left side and the rigth side as it was


you did an adjustment to show data after 7w2016
No I didn't make any adjustment.

Please attach the workbook that the picture came from.
Adjunte el libro de trabajo del que proviene la imagen.
You should be using the workbook that I attached here which is 29203972.xlsm
User generated image
User generated image
29173941.xlsm.xlsm did not work beause the code was looking for 4N and not 3N. I changed it to look for 3N and attached 29203972.xlsm which does work. I double-checked it. Here is a picture of a part of it.

29173941.xlsm.xlsm no funcionó porque el código buscaba 4N y no 3N. Lo cambié para buscar 3N y adjunté 29203972.xlsm que funciona. Lo comprobé dos veces. Aquí hay una imagen de una parte.
User generated image
Ok I see
Please let me verify it