Solved

Excel Clear Contents

Posted on 2012-04-01
4
360 Views
Last Modified: 2012-06-27
How can I add range "a & i", and "l & i", and l, to the code below.

I tried changing to
wks.Range("i" & i & "a" & i  & "l" & i ":k" & i).Cells.SpecialCells(xlTextValues).ClearContents
and
I tried changing to
wks.Range("i" & i & ":a" & i & ":l" & i  ":k" & i).Cells.SpecialCells(xlTextValues).ClearContents


For i = 6 To 45
       
            If InStr(LCase(wks.Name), "wire") > 0 Then
                If Range("B" & i).Value = " " Then
                    wks.Range("i" & i & ":k" & i).Cells.SpecialCells(xlTextValues).ClearContents
                    End If
            End If
            If False Then bTest = True      'You need to have a valid test here
        Next i
0
Comment
Question by:mato01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Norie
ID: 37793369
What range do you want?

If it was row 6 would it be cells A6, I6, K6 and L6?
0
 

Author Comment

by:mato01
ID: 37793376
For i = 6 To 45

is handling the rows, so "a & i" is equal to A6
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 200 total points
ID: 37793379
wks.Range("a" & i & ", i" & i & ":l" & i).Cells.SpecialCells(xlTextValues).ClearContents


*edited*
0
 
LVL 34

Expert Comment

by:Norie
ID: 37793390
What other columns do you want to include?

You mention adding "a & i", and "l & i", and l to "i" & i & ":k" & i".

Do you mean you want to include columns A and I to L?
Range("A"& I & ", I"&I & ":L" & I).SpecialCellx(xlTextValues).ClearContents
 

Open in new window

0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question