Scan two separated columns at the same time

croquet

New Member
Joined
Mar 28, 2008
Messages
9
¡Hello!

First of all thank you very much for all the great people in this forum, more than once I have found my questions answered in other user’s doubts… however this time I haven’t been able to find it, that’s why I am writing this post.
Sorry if this question may seem obvious or may have been answered before, but as I said before, I haven’t been able to find any suitable answer in the forum.

I have got the spreadsheet shown below, I am trying to calculate the monthly price sum by going through the date column to check in which month we are and then adding the values of the ammount column to obtain the monthly ammount when we the month changes.
The problem comes when I try to go down the date column: I save the cell address in a variable called date_address but when I do date_address = date_address+1 Excel says that “types are not equal” (or something like that because I am translating directly from Spanish, sorry)

Is there any way of doing it in parallel? Because I have to go down two different columns at the same time:<o:p></o:p>
  • Date column to check when we change the month and calculate the sum when that happens.<o:p></o:p>
  • Ammount column to keep adding the cells for the sum<o:p></o:p>
Part of the code is attached below... have done it only for January values since I get stucked there and cannot go forward.
Thank you very much in advance for any possible comments, critics, suggestions, etc.

Code:
Sub fecha()
   
  ‘variables
  Dim date_value As Date
  Dim mes As Integer
   
  'initialise month scanning
  initial_cell = "F4"
  final_cell = "F20"
  min_row = Range(initial_cell).Row
  max_row = Range(final_cell).Row
  min_column = Range(initial_cell).Column
  max_column = Range(final_cell).Column
  'we place ourselves in the first cell
  Range(initial_cell).Select
   
  'loop for checking the months
  For i = min_row To max_row
  For j = min_column To max_column
        
      'store the date
      date_value = ActiveCell.Value
      'store the cell address
      date_address = ActiveCell.Address(False, False)
      'store the month number
      mes = Month(date_value)
      ActiveSheet.Range("C1").Value = date_value
      ActiveSheet.Range("C2").Value = date_address
      ActiveSheet.Range("C3").Value = mes
      'go to the first cell of ammount column
      ActiveCell.Offset(0, 6).Select
      'store the address of the first value for the sum
      initial_cell = ActiveCell.Address

      'keep going through the ammount cells till we change the month
      ‘If January
      If mes = 1 Then
           ‘move to the following cell in the ammount column
          ActiveCell.Offset(1, 0).Select
          date_address = date_address + 1 <-- here is where it crashes
          ‘here theres should be more code but since it crashes in
          'the previous line, cannot continue
      End If
      
      'set the final cell of the range to do the sum
      'get the address of the active cell which is the last one
      final_cell = ActiveCell.Address
      'move one cell down and calculate the sum
      ActiveCell.Offset(1, 0).Activate    
      ActiveCell.Formula = "=Sum(" & initial_cell & ":" & final_cell & ")"
                  
  ActiveCell.Offset(0, 0).Select
  Next
  ActiveCell.Offset(1, 0).Select
  Next
          
  End Sub
<!--[if !supportLineBreakNewLine]-->
<!--[endif]--><o:p></o:p>


<script language="JavaScript" src="http://www.interq.or.jp/sun/puremis/colo/popup.js"></script><center><table align="center" cellpadding="0" cellspacing="0"><tbody><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0);" colspan="7" bgcolor="#0c266b"><table align="center" border="0" width="100%"><tbody><tr><td align="left">Microsoft Excel - Libro2.xls</td><td style="font-size: 9pt; color: rgb(255, 255, 255); font-family: caption;" align="right">___Running: 11.0 : OS = Windows XP </td></tr></tbody></table></td></tr><tr><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); height: 25px;" colspan="7" bgcolor="#d4d0c8"><table valign="MIDDLE" align="center" border="0" width="100%"><tbody><tr><td style="font-size: 10pt; color: rgb(0, 0, 0); font-family: caption;">(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout</td><td align="right" valign="center"><form name="formCb059465"><input onclick='window.clipboardData.setData("Text",document.formFb543420.sltNb142651.value);' value="Copy Formula" name="btCb290334" type="button"></form></td></tr></tbody></table></td></tr><tr><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0);" colspan="7" bgcolor="white"><table border="0"><tbody><tr><form name="formFb543420"></form><td style="width: 60px;" align="center" bgcolor="white"><select onchange="document.formFb543420.txbFb965317.value = document.formFb543420.sltNb142651.value" name="sltNb142651"><option value="2320" selected="selected">F3</option></select></td><td align="right" bgcolor="#d4d0c8" width="3%">=</td><td align="left" bgcolor="white"><input size="80" value="F Entrprev" name="txbFb965317"></td></tr></tbody></table></td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); background-color: rgb(212, 208, 200);" align="center" width="2%">
</td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: black; font-family: menu; background-color: rgb(212, 208, 200);" align="center"><center>F</center></td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: black; font-family: menu; background-color: rgb(212, 208, 200);" align="center"><center>G</center></td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: black; font-family: menu; background-color: rgb(212, 208, 200);" align="center"><center>H</center></td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: black; font-family: menu; background-color: rgb(212, 208, 200);" align="center"><center>I</center></td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: black; font-family: menu; background-color: rgb(212, 208, 200);" align="center"><center>J</center></td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: black; font-family: menu; background-color: rgb(212, 208, 200);" align="center"><center>K</center></td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>3</center></td><td style="border-style: solid; border-color: rgb(0, 0, 0) rgb(212, 208, 200) rgb(212, 208, 200) rgb(0, 0, 0); border-width: 0.5pt; font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F Entrprev</td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">Gaart Cod</td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">Pedido</td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">Servido</td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">Pdiente</td><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">IMPORTE</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>4</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">18-ene-08</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F03314</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">30</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">30</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>5</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F03912</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">311,37</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>6</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F03922</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">350</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>7</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F33116</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">5</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">5</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">2100,24</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>8</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>9</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>10</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">21-feb-08</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">FE06325</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">2</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">2</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">138,18</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>11</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">FE06330</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">86,59</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>12</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">FE06335</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">99,49</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>13</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">FE06340</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">1</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">124,36</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>14</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F69406</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">16</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">16</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">3257,28</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>15</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F80390</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">3</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">3</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">413,4</td></tr><tr><td style="border-top: 0.5pt solid rgb(0, 0, 0); border-left: 0.5pt solid rgb(0, 0, 0); font-size: 10pt; color: rgb(0, 0, 0); font-family: menu; background-color: rgb(212, 208, 200);" align="center" width="2%"><center>16</center></td><td style="border-left: 0.5pt solid rgb(0, 0, 0); border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;"> </td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: left;">F80440</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">20</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">20</td><td style="border-right: 0.5pt solid rgb(212, 208, 200); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">0</td><td style="border-right: 0.5pt solid rgb(0, 0, 0); border-bottom: 0.5pt solid rgb(212, 208, 200); font-size: 10pt; vertical-align: bottom; color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(255, 255, 255); text-align: right;">2320</td></tr><tr><td style="border-style: solid; border-color: rgb(128, 128, 128) rgb(0, 0, 0) rgb(0, 0, 0); border-width: 0.5pt; background-color: rgb(212, 208, 200);" colspan="7"><table valign="TOP" align="left" width="100%"><tbody><tr><td style="border-style: solid; border-color: rgb(128, 128, 128) rgb(0, 0, 0) rgb(0, 0, 0); border-width: 0.5pt; width: 120pt; background-color: rgb(255, 255, 255);" align="left">Hoja2</td><td> </td></tr></tbody></table></td></tr></tbody></table>
[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.</center>
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
The problem is you are trying to adda number to a string. The easiest way to fix this might be by changing that problem line to this

date_address = range(date_address).Offset(1).Address

Another thing you can do is to break date_address into two fields. Date_Row & Date_Column. Both values are numeric so Date_Row = 6 and Date_Column = 4. Then you can do a Date_Row = Date_Row + 1. When you need to refer to that cell, instead of Range(Date_Range) you use Cell(Date_Row,Date_Column).
 
Upvote 0
Fractaloon you saved my day!!
icon_yeah.gif
Thanks a million for your answer.
999.gif

Breaking the date_address into column&row is so simple but powerful, works like a charm... man sometimes the most difficult things end up with the easiest solution.
icon_doh.gif


Thank you also for confirming my idea that what makes this forum so special is its people.
¡¡Thank you Fractaloon!!
icon_thumright.gif
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top