• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to give wide range

Abhijeet

Active Member
Hi

I do not know how to give wide range in VBA i have one macro if data range more than A29 then macro give till O29& P29 row not going forward.please help me for this data is not fix so tell me wide range what ever data in last row till row macro give result
 

Attachments

Hi
I this code will run till O29 but my data if more than this range then i am not geting result so please give me what ever data in last row this macro will run


Sub Macro1()

ActiveCell.FormulaR1C1 = _
"=RC[-14]&""-""&RC[-11]&""-""&RC[-9]&""-""&RC[-8]&""-""&RC[-7]&""-""&RC[-6]&""-""&RC[-5]&""-""&RC[-4]&""-""&RC[-3]&""-""&RC[-2]&""-""&RC[-1]"
Range("O2").Select
Selection.AutoFill Destination:=Range("O2:O29"), Type:=xlFillDefault
Range("O2:O29").Select
Selection.End(xlUp).Select
Range("P2").Select
ActiveCell.FormulaR1C1 = _
"=IF(COUNTIF(C[-1],RC[-1])>1,""Duplicate"",""Not Duplicate"")"
Range("P2").Select
Selection.AutoFill Destination:=Range("P2:P29")
Range("P2:P29").Select
Range("P2").Select
End Sub
 

Please respect this forum by using cod tags ‼

See property End(xlUp) for example … You already had this answer
in some of yours own past threads like Copy paste from multiple excel file ! …

______________________________________________________________
A Copy / Paste brain is not the Brain !
 
Back
Top