Complicated if/then copy operation?
Closed
Spremo
Posts
1
Registration date
Friday 26 June 2015
Status
Member
Last seen
26 June 2015
-
26 Jun 2015 à 18:15
Seth - 29 Jun 2015 à 17:50
Seth - 29 Jun 2015 à 17:50
Related:
- Complicated if/then copy operation?
- Could not complete this operation. there was not enough memory available - Guide
- Bluetooth operation - Guide
- Wifi operation - Guide
- Everything about different WiFi modes of operation - Guide
- Email operation - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
29 Jun 2015 à 04:38
29 Jun 2015 à 04:38
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
29 Jun 2015 à 17:34
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.
29 Jun 2015 à 17:50
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