Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 392
  • Last Modified:

Excel Macro copy Cell range not empty between worksheets

hi

i like to copy all values in cells are filled from Cell E2 down in worksheet PROCESS to Worksheet EXPORT from Cell  N2 down. All cells are "not filled" has a #NV with formula because of missing data. All cells are filled has a value like
an email-adress "test@domain.com"

i've found an example but it copying if the cells are colored.

Option Explicit
Function CountByColor(CellColor As Range, SumRange As Range)
Dim myCell As Range
Dim iCol As Integer
Dim myTotal
iCol = CellColor.Interior.ColorIndex
For Each myCell In SumRange
If myCell.Interior.ColorIndex = iCol Then
  myTotal = myTotal + 1
End If
Next myCell
CountByColor = myTotal
End Function

Open in new window


Thanks in advance for your help
0
Mandy_
Asked:
Mandy_
  • 3
  • 3
1 Solution
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
Don't know what your question is. Maybe if you post the spreadsheet, it might help.
0
 
Mandy_Author Commented:
Hi phillip

2 pictures. hope that helps. It should be a macro not a formula.

source
copy only cells with values to other worksheet called export N2 down

destination
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
I still have no idea what your question is - maybe you can rephrase.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Mandy_Author Commented:
How could i code this in VBA macro?  if cell in sheet1 has a value (see picture) copy to sheet2 column N2 downstairs.
If sheet1 not have a value (0 or #NV) not copy it. Thats it!
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
Sub CopyItems()
On Error Resume Next
For introw = 2 To 9999
    Select Case Sheets("Process").Cells(introw, 14)
    Case 0, "", "#NV"
    Case Else
        Sheets("Export").Cells(introw, 14) = Sheets("Process").Cells(introw, 14)
    End Select
Next
End Sub
0
 
Mandy_Author Commented:
Thats it! Thank you so much.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now