Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
I am trying to write a macro using If...Then
I am trying to write a macro that will look at the value in column G. If
that value is blank or zero, then select the entire row and delete it. Then I want it to populate columns A with a number "111119" and column H with "TEXT" Here's what I tried, but it's not working. (There are other sorts, etc. that precede this item in the macro, that seem to be working fine.) If Range("g:g") < 1 = true Then ActiveWorkbook.Worksheets("Tab3 Upload").Rows.Select Selection.Delete End If If Range("b:b") 1 Then Range("a:a").Select Selection.Fill "111119" Range("h:h").Select Selection.Fill "TEXT" End If End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
I am trying to write a macro using If...Then
Your question is not clear. Did you want to look at the values of each
individual cell in the column and make decisions based on those values? So if Cells G2, G4, G6 are blank then delete rows 2, 4 and 6 while leaving the rest? Are the values in G based on formulas or are they constants? -- HTH... Jim Thomlinson "AJ" wrote: I am trying to write a macro that will look at the value in column G. If that value is blank or zero, then select the entire row and delete it. Then I want it to populate columns A with a number "111119" and column H with "TEXT" Here's what I tried, but it's not working. (There are other sorts, etc. that precede this item in the macro, that seem to be working fine.) If Range("g:g") < 1 = true Then ActiveWorkbook.Worksheets("Tab3 Upload").Rows.Select Selection.Delete End If If Range("b:b") 1 Then Range("a:a").Select Selection.Fill "111119" Range("h:h").Select Selection.Fill "TEXT" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to write a macro | Excel Discussion (Misc queries) | |||
how do i write a macro | Excel Worksheet Functions | |||
How to write a macro?? | Excel Discussion (Misc queries) | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
How do I write a macro for... | Excel Discussion (Misc queries) |