We help IT Professionals succeed at work.
Get Started

Excel 2010 Select range without top row (NOT using loop)

N M
N M asked
on
95 Views
Last Modified: 2015-09-08
I have in Excel sheet "Data" 11 rows and 12 columns of data. First row is headers of columns, and they all have comments.
Comments are not allowed on any other cell (consider it given).

I try to right row by row and column by column all data in another sheet "Log" in same workbook. BUT I don't want the first row (the headers). I tried lots of things but don't work. I DO NOT WANT TO USE LOOPS please.

Code that doesn't work is commented below. My small Sub follows:

Option Explicit

    Dim cmt As Comment      'comment
    Dim ws As Worksheet     'working sheet
    Dim wsLog As Worksheet  'log sheet
    Dim CommRange As Range  'comments range


Public Sub ReadValues()      'reads values of rows

    Dim Rng As Range
    Dim i As Integer
    Dim cC As Integer   'character count
    
    Set CommRange = ws.Cells.SpecialCells(xlCellTypeConstants)
    
    'Set CommRange = Rng.Offset(1).Resize(Rng.Rows.Count - 1)
    
    i = wsLog.Cells(Rows.Count, 1).End(xlUp).Row + 1
    
    If Not CommRange Is Nothing Then
        For Each Rng In CommRange
            If Application.IsText(Rng) Then
                cC = Rng.Characters.Count
            End If
            wsLog.Cells(i, 1).Resize(1, 7).Value = _
            Array(ws.Name, Rng.Address(ReferenceStyle:=xlR1C1), Formatter(Rng.Text), "", "", cC, Rng.Cells.Text)
            i = i + 1
        Next
    End If
    
End Sub

Open in new window


I tried to exclude with Intersect the following:

ws.Cells.SpecialCells(xlCellTypeComments)

Open in new window


but didn't work :(

All help would be appreciated (kindly NO LOOPS For i.. Next etc) Thank you!
Comment
Watch Question
Group Finance Manager
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 23 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE