I'm trying to create a macro and I have problems trying to use the Replace
command when it affects a formula in VisualBasics.
My situation is this:
In column L I have calculations of slope of different ranges: =PENDIENTE(G33:G60;C33:C60)
=PENDIENTE(G95:G122;C95:C122)
etc.
I have to change the PENDING calculation by AVERAGE (the excel is in Spanish so the operations have it in Spanish) so that it is: =PROMEDIO(G33:G60)
=PROMEDIO(G95:G122)
etc.
After some attempts I stayed here (I do not know if it's okay either):
Dim Cadena1 As String
Cadena1 = Replace("=PENDIENTE(G*:G*;C*:C*)", "PENDIENTE", "PROMEDIO")
Dim Cadena2 As String
Cadena2 = Replace("=PROMEDIO(G*:G*;C*:C*)", ";C*:C*", " ")
Dim iRow, StartRow As Integer
Dim Col1, ColValues As String
Col1 = "L"
ColValues = "M"
StartRaw = 2
NumRows = Range(Col1 & StartRow, Range(Col1 & StartRow).End(xlDown)).Rows.Count
Any advice? If anyone knows a VisualBasics manual that could help or something similar, I would also appreciate it.