Advertisement

02.12.2008 at 01:35AM PST, ID: 23155536
[x]
Attachment Details

Object Types vs Value Types

Asked by jell in Microsoft Excel Spreadsheet Software

Tags: VBA, Excel

Hi Guys,

It's early and I've got a brain freeze.

How do I copy an object as opposed to just referencing it?

For example:

Dim i as integer, j as integer
i = 1
j = i
j = j + 1

'i = 1
'j = 2

Is great for values.

But with objects

Dim wks1 as worksheet, wks2 as worksheet
set wks1 = worksheets.add
wks1.[A1] = 1
wks2 = wks1
wks2.[A1] = 2

'wks1.[A1] = 2
'wks2.[A1] = 2

How do I make wks accept a 'copy' of wks1, and not a reference to it??


Thanks

Jell





Start Free Trial
[+][-]02.12.2008 at 02:01AM PST, ID: 20873570

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.12.2008 at 02:04AM PST, ID: 20873580

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.12.2008 at 02:07AM PST, ID: 20873598

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.12.2008 at 03:02AM PST, ID: 20873848

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: VBA, Excel
Sign Up Now!
Solution Provided By: rorya
Participating Experts: 3
Solution Grade: A
 
 
[+][-]02.12.2008 at 03:59AM PST, ID: 20874047

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.12.2008 at 04:31AM PST, ID: 20874187

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628