Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I'm copying and pasting onto excel from an accounting program, and it's
pretty inconsistant. Whenever a new heading pops up, it either deposits the first cell in the A column, and the second cell in the C column, or it deposits the first cell in the B column, and the second cell in the C column. I can write a function to identify this =IF(A#="",IF(B#="","","deleteA"),"deleteB") where # stands for whatever row I happen to be in. And I figured out how to write a MACRO to delete a specific cell. But with six thousand rows, and doing this pretty often, it sure would be nice to automate it. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
On Tue, 8 Jul 2008 16:33:02 -0700, Mr_Crowe
wrote: I'm copying and pasting onto excel from an accounting program, and it's pretty inconsistant. Whenever a new heading pops up, it either deposits the first cell in the A column, and the second cell in the C column, or it deposits the first cell in the B column, and the second cell in the C column. I can write a function to identify this =IF(A#="",IF(B#="","","deleteA"),"deleteB") where # stands for whatever row I happen to be in. And I figured out how to write a MACRO to delete a specific cell. But with six thousand rows, and doing this pretty often, it sure would be nice to automate it. Any ideas? I'm not sure what you want to do. The logic of your function says if there is anything in A#, delete whatever is in B#, otherwise if there is anything in B#, delete whatever is in A#. And don't delete anything if there is nothing in A# or B#. But the second part is redundant since there couldn't be anything in A# to delete. Your description suggests that there will be data in either A# or B#. Perhaps something like this would put all the new headings into col A: ============= Option Explicit Sub Foo() Dim c As Range For Each c In Range("A1:A6000") With c If .Value = "" Then .Value = .Offset(0, 1).Value .Offset(0, 1).ClearContents End With Next c End Sub ================ But again, I'm not sure if that is what you want. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combine two macros | Excel Worksheet Functions | |||
Possible to combine VLOOKUP and IF(AND) functions? | Excel Worksheet Functions | |||
Combine functions? | Excel Worksheet Functions | |||
Combine functions into one cell | Excel Worksheet Functions | |||
How can I combine the functions of a vlookup and sumif without a p | Excel Worksheet Functions |