how to copy contents from merged cell to a single cell using vba

riaanrmc

New Member
Joined
Apr 7, 2010
Messages
5
Good Day

I am trying to copy values from merged cell to a cingle cell using vba.

the following code overwrites the cell next to it because of the merged cell .

Sub Bevel49_Click() '''NEW NTD


Worksheets("Torgue Gage Calibration").Activate
Range("K6").Select
Selection.Value.Copy


Worksheets("Torgue Gages DataBase").Activate
Range(Range("N1").Value).Select
Selection.PasteSpecial Paste:=xlPasteValues
Worksheets("Torgue Gage Calibration").Activate
Application.CutCopyMode = False


the K6 is the merged cells and (Range("N1").Value) is the destination.

Thanks in advance.

This code at the top took me 6 days to compile , so now you can see my experiance level.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try
Code:
   Worksheets("Torgue Gage Calibration").Range("K6").Copy Destination:=Worksheets("Torgue Gages DataBase").Range("N1")
 
Upvote 0
While taking my lunch I thought this might be the issue.
If K6 has a formula and you need the Value in N1 try

Code:
Sub Bevel49_Click() 
      Worksheets("Torgue Gages DataBase").Range("N1").Value = Worksheets("Torgue Gage Calibration").Range("K6").Value
End Sub
 
Upvote 0
no not working .

i need to copy and paste, this is an lookup and paste code i am trying.

thanks for the reply
 
Upvote 0
Do you really need the merged cells?

As you are finding out they just cause problems.

If you must keep them then you might want to look into the MergeArea property.

I'll admit I don't know quite how you would/could use it because I've never really used it.

I'll have a look into it and see if I can post something.:)
 
Upvote 0
All I am getting from your post is K6 is merged Cells and you want to Copy and Paste it to N1 on a different sheet

here is a Copy/Paste code

Code:
Sub Bevel49_Click() 
   Worksheets("Torgue Gage Calibration").Range("K6").Copy
   Worksheets("Torgue Gages DataBase").Range("N1").PasteSpecial Paste:=xlPasteValues
   Application.CutCopyMode = False
End Sub

I've merged cells K6:M9 entered a formula and copied the value to N1

If I'm not understanding what you need please clarify.:)
 
Upvote 0
the merged cells are transferred to my destination , so any data right and down is being replaced by blank cells, and thus overwriting my data that was in that cells.

i need to only copy the value and paste the value again into a single cell ,without overwriting my data in my nextdoor cells
 
Upvote 0

Forum statistics

Threads
1,222,614
Messages
6,167,062
Members
452,093
Latest member
JamesFromAustin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top