paste values without copy-paste values

R

Rikkart

Can I replace the copy-paste values code with something like
<range>.cells(i,j).value = <range>.cells(k,l).formula ? (or .text or .? or
....)

I have a standard list with standard columns, and operational lists with
subsets of columns.
I also have an equivalence table between columns, to accomodate for
titleswitching, missing columns and changes in the order.
Now when I try a nested loop for rows and columns, applying a
"<standardlistrange>.cells(i,j).formula =
<operationalrange>.cells(i,k).value" formula to every cell, I get good
results,
EXCEPT FOR e.g. text being converted to a date ( "5 - 10" in the "number of
employees" column becomes a date) and telephone number text fields become
numbers in standard format etc. PasteValues doesn't do this, but I'd like to
avoid the copy-paste cycle inside my nested loop for speed...

Thanks beforehand

..cells(i,j).formula =
 
D

Dave Peterson

You could set the format to be the same:

with somecell
.numberformat = someothercell.numberformat
.value = someothercell.value
end with
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top