Complicated if/then copy operation?
Closed
Spremo
Posts
1
Registration date
Friday June 26, 2015
Status
Member
Last seen
June 26, 2015
-
Jun 26, 2015 at 06:15 PM
Seth - Jun 29, 2015 at 05:50 PM
Seth - Jun 29, 2015 at 05:50 PM
Related:
- Complicated if/then copy operation?
- Could not complete this operation. there was not enough memory available - Guide
- Disc error detected retrying operation ps3 - Guide
- Operation panel closed 1240 - Guide
- Operation mode access point - Guide
- Printer error show operation failed with error 0x0000007e - Printers & Scanners Forum
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jun 29, 2015 at 04:38 AM
Jun 29, 2015 at 04:38 AM
in C8 the formula is
=IF(A8<>"",A8,"")
copy C8 down
if you want vba here is the macro
=IF(A8<>"",A8,"")
copy C8 down
if you want vba here is the macro
Sub test()
Dim r As Range, c As Range
Set r = Range("A8:A42")
For Each c In r
If c <> "" Then c.Copy c.Offset(0, 2)
Next c
End Sub
Jun 29, 2015 at 05:34 PM
This is a three-part problem to try to get excel to search an area, (A8:A42), and if there's a value in any cell within that range, then copy the formula contained within cell C2 to the same row as the value, except two columns to the right.
In my range A8:A42, Only about 1 in 8 cells will have a value. I have a formula saved in cell C2 that I need to manually paste apply to Column C, for any rows that have a value in column A.
basically... cell C2 has a formula in it. The formula can't be put into cells in the range (A8:A42) that are blank, or it will screw up my totals at the bottom.
Lets say, within my range of A8:A42, only three cells have values: A12, A32, and A41. I'd then want the formula in cell C2 to be copied to C12, C32, and C41 -- and ONLY those cells.
Thanks for any help. I probably didn't articulate the idea very clearly.
Jun 29, 2015 at 05:50 PM
Sub MacroTestAutoFill()
'
' MacroTestAutoFill Macro
'
' Keyboard Shortcut: Ctrl+Shift+M
'
Dim r As Range, c As Range
Set r = Range("T10:T205")
For Each c In r
If c = "" Then
Range("T5").Copy
Range("").Select
ActiveCell.Paste
Next c
End If
End Sub