Solved

Excel Clear Contents

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

830 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