excel - How can I wrap an If statement around this code? -
i given project work on , i'm bit stumped. have routine being driven shortcut macro move data column column f , begin build itemized list 1 works through column.
what need, however, wrap current operation in if statement operation not move data new cell if data in g5 (or, rc) equal cell value in a4 (or, rc-1). if can logic down, can operation work intended.
the macro created macro recorder, here code:
sub inserttagline() selection.insert shift:=xldown activecell.offset(1, 0).range("a1").select selection.copy activecell.offset(-1, 4).range("a1").select activesheet.paste activecell.offset(0, 1).range("a1").select application.cutcopymode = false activecell.formular1c1 = "=""tag: ""&rc[-1]" activecell.select selection.copy selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false activecell.offset(0, -1).range("a1").select application.cutcopymode = false selection.clearcontents activecell.offset(0, -3).range("a1").select activecell.formular1c1 = "1" activecell.offset(0, 1).range("a1").select activecell.formular1c1 = "=r[-1]c+1" activecell.offset(1, 0).range("a1").select activecell.formular1c1 = "=r[-1]c+1" activecell.offset(1, 0).rows("1:1").entirerow.select end sub
do need more complicated wrap of code in if statement?
if (range("g5").value <> range("a4").value) 'your code end if
Comments
Post a Comment