Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel Clear Contents

Posted on 2012-04-01
4
Medium Priority
?
365 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 35

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 800 total points
ID: 37793379
wks.Range("a" & i & ", i" & i & ":l" & i).Cells.SpecialCells(xlTextValues).ClearContents


*edited*
0
 
LVL 35

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
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.

618 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