Help with a couple lines of code

M

Matthew

I am using an excel automation module. the following two
lines i'm not sure how i can manipulate it.

With objActiveWkb
..Worksheets(1).Cells(1, 2) = .Worksheets(1).Cells(1, 1)
strWhat = .Worksheets(1).Cells(1, 1).Value
End With

I'm not sure what these two lines mean. For instance,
would i be able to change this to say Cells(A1) = the
value in Cell(A2)
so ending result would be cell A1 and A2 had identicle
values. Any help would be terrific. Thankyou. Matthew
 
O

onedaywhen

Try

.Worksheets(1).Cells(1, 1).Value = .Worksheets(1).Cells(2, 1).Value

alternatively

.Worksheets(1).Range("A1").Value = .Worksheets(1).Range("A2").Value

Beware the use of default properties.
 
G

Guest

Thanks alot! this worked perfectly.
-----Original Message-----
Try

.Worksheets(1).Cells(1, 1).Value = .Worksheets (1).Cells(2, 1).Value

alternatively

.Worksheets(1).Range("A1").Value = .Worksheets (1).Range("A2").Value

Beware the use of default properties.
 

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