SuemyMontanheiro
New Member
- Joined
- Sep 8, 2017
- Messages
- 1
Hi guys,
I’ve been insanely looking for this on the web, but couldn’t find anything that would make me get why this is not working. I’m new to VBA and my knowledge is very limited, for most things I use the “record macro” option to get the code and just paste it where I need it to be on my macro – but for this one it just isn’t working and I can´t seem to fix it or understand what is going wrong.
I need the macro to type this 3 formulas below, on the left cells. My issue is that when it goes on the code (on those RC language for the rows and columns), it turns into what’s in the right cell. Could you please help me understand what is going on and how to get the macro to write the right code? If it helps, the sheet “SQ01” has around 10k-15k lines and I’m looking from line 2 and down. So if it’s not possible to search on range B:G, using $S$2:$G$30000 would be fine.
Thank you in advance for your help.
[TABLE="class: x_MsoNormalTable, width: 1757"]
<tbody>[TR]
[TD="width: 536"]What I need
[/TD]
[TD="width: 687"]How it looks in the macro
[/TD]
[TD="width: 535"]What I get
[/TD]
[/TR]
[TR]
[TD="width: 536"]=VLOOKUP(C2,'SQ01'!B:G,6,0)
[/TD]
[TD="width: 687"]=VLOOKUP(RC[-9],'SQ01'!R2C1:R30000C7,6,0)
[/TD]
[TD="width: 535"]=VLOOKUP(C3,'SQ01'!$C$2:$C$30000,6,0)
[/TD]
[/TR]
[TR]
[TD="width: 536"]=IF(L2>42736,TEXT(L2,"[$-409]mmm"),"Created before 2017")
[/TD]
[TD="width: 687"]=IF(RC[-1]>42736,TEXT(RC[-1],""[$-409]mmm""),""Created before 2017"")
[/TD]
[TD="width: 535"]=IF(L3>42736,TEXT(L3,"[$-409]mmm"),"Created before 2017")
[/TD]
[/TR]
[TR]
[TD="width: 536"]=IF(A2="Inactive",TEXT(VLOOKUP(C2,'SQ01'!B:G,6,0),"[$-409]mmm"),"MISC Active")
[/TD]
[TD="width: 687"]=IF(RC[-13]=""Inactive"",TEXT(VLOOKUP(RC[-11],'SQ01'!C[-12]:C[-7],6,0),""[$-409]mmm""),""MISC Active"")
[/TD]
[TD="width: 535"]=IF(A3="Inactive",TEXT(VLOOKUP(C3,'SQ01'!C:C,6,0),"[$-409]mmm"),"MISC Active")
[/TD]
[/TR]
</tbody>[/TABLE]
---
I’ve been insanely looking for this on the web, but couldn’t find anything that would make me get why this is not working. I’m new to VBA and my knowledge is very limited, for most things I use the “record macro” option to get the code and just paste it where I need it to be on my macro – but for this one it just isn’t working and I can´t seem to fix it or understand what is going wrong.
I need the macro to type this 3 formulas below, on the left cells. My issue is that when it goes on the code (on those RC language for the rows and columns), it turns into what’s in the right cell. Could you please help me understand what is going on and how to get the macro to write the right code? If it helps, the sheet “SQ01” has around 10k-15k lines and I’m looking from line 2 and down. So if it’s not possible to search on range B:G, using $S$2:$G$30000 would be fine.
Thank you in advance for your help.
[TABLE="class: x_MsoNormalTable, width: 1757"]
<tbody>[TR]
[TD="width: 536"]What I need
[/TD]
[TD="width: 687"]How it looks in the macro
[/TD]
[TD="width: 535"]What I get
[/TD]
[/TR]
[TR]
[TD="width: 536"]=VLOOKUP(C2,'SQ01'!B:G,6,0)
[/TD]
[TD="width: 687"]=VLOOKUP(RC[-9],'SQ01'!R2C1:R30000C7,6,0)
[/TD]
[TD="width: 535"]=VLOOKUP(C3,'SQ01'!$C$2:$C$30000,6,0)
[/TD]
[/TR]
[TR]
[TD="width: 536"]=IF(L2>42736,TEXT(L2,"[$-409]mmm"),"Created before 2017")
[/TD]
[TD="width: 687"]=IF(RC[-1]>42736,TEXT(RC[-1],""[$-409]mmm""),""Created before 2017"")
[/TD]
[TD="width: 535"]=IF(L3>42736,TEXT(L3,"[$-409]mmm"),"Created before 2017")
[/TD]
[/TR]
[TR]
[TD="width: 536"]=IF(A2="Inactive",TEXT(VLOOKUP(C2,'SQ01'!B:G,6,0),"[$-409]mmm"),"MISC Active")
[/TD]
[TD="width: 687"]=IF(RC[-13]=""Inactive"",TEXT(VLOOKUP(RC[-11],'SQ01'!C[-12]:C[-7],6,0),""[$-409]mmm""),""MISC Active"")
[/TD]
[TD="width: 535"]=IF(A3="Inactive",TEXT(VLOOKUP(C3,'SQ01'!C:C,6,0),"[$-409]mmm"),"MISC Active")
[/TD]
[/TR]
</tbody>[/TABLE]
---