Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Laaibah Malik   on Feb 28 In MS Office Category.

  
Question Answered By: Harriet Hughes   on Feb 28

: I don't know if my previous message posted, but..
: I added:
: Sheets("DMH").Activate
: because I am running the macro  from the "ALLDATA" sheet
: It's seemed to work??

Are you asking a question or just using question marks
instead of periods?


: Ok, now, I figured I'll just copy  past the above code change
: a few things around for another worksheet and the same would
: work for that?
: Wrong...
: I get "cannot change part  of a merged cell"

You might have merged cells  in the destination which Excel
won't let you overwrite. This is a feature, not bug. :) I was
able to reproduce the error in Excel by merging cells A1:C4 in
the destination sheet  and trying to copy cells A1:E2 from the
source sheet.

If you can't remove the merged cells manually, start a new
thread for programmatic solutions.


: On the next part I added  for the "DMR" worksheet..
:
: ActiveSheet.Range("A14:ad25", Range("A14:ad25").End(xlToRight)).Copy _
: Destination:=Worksheets("DMR").Range("A2")
:
: Am I supposed to reset something??

It looks like you have this code. It should copy the range
A14:ad25 plus extra contiguous stuff to the right of that range
from DMH to DMR. Is that what is happening? If not, explain what
is happening.

Sheets("DMH").Activate
ActiveSheet.Range("A14:ad25", Range("A14:ad25").End(xlToRight)).Copy _
Destination:=Worksheets("DMR").Range("A2")

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on If statement in a macro ? Or get search suggestion and latest updates.


Tagged: