?
Solved

VBA Excel - Error checking cell value on cells containing TRANSPOSE forumla

Posted on 2013-01-17
1
Medium Priority
?
563 Views
Last Modified: 2013-01-19
Hi,

I have a range of cells that I need to check if they are empty or 0.

The cells contain a formula "=TRANSPOSE(''A2:JK8)"

As a result, any time I try to check the cell value or modify the cell value I seem to get "type mismatch" errors.

If Range("A2:JK8").value = "" Then

Open in new window


Can anybody help me get around this?

I attempted to convert the cell to a value (and remove the formula) but I got an error "cannot change part of an array".
Range("A2:JK8").value = Range("A2:JK8").value

Open in new window


Thankyou
0
Comment
Question by:mhdi
[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
1 Comment
 
LVL 24

Accepted Solution

by:
Steve earned 2000 total points
ID: 38791966
Which cells contain the TRANSPOSE formula, it will not just be one cell but an array of cells.

You need to work with the array of cells holding transpose formula.

Simple Example workbook attached.

To change the cells to values use:

Sheets("Sheet2").Range("B2:H283").value = Sheets("Sheet2").Range("B2:H283").value

Open in new window

Transpose-VBA-Example.xlsm
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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