Solved

Excel Clear Contents

Posted on 2012-04-01
4
357 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
  • 2
4 Comments
 
LVL 33

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 33

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now