Solved

Excel Clear Contents

Posted on 2012-04-01
4
356 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

757 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

20 Experts available now in Live!

Get 1:1 Help Now