Range HELP

GormanRupp

New Member
Joined
Nov 6, 2012
Messages
14
I have a previously written macro for an old sheet that i would like to use. Unfortunatley i have to take a new worksheet given to me and Unmerge Columns a and b starting with cell 3 of the active cells on the sheet and then copy Columns C and D and paste them in column B. Then i can run the macro as normal. I have this portion from the Macro Recorder, but i cannot get the ranges for the unmerging and copying and pasting portion down correctly. Can anyone help with this? Thank you for your time! It is greatly appreciated!
 
In what way can't you "get the ranges for the unmerging and copying and pasting portion down correctly"? What code do you curently have?
 
Upvote 0
Andrew thank you for your reply I really appreciate the interest. The old macro before was taking part numbers and creating hyperlinks.

What's happening now is at my starting point, columns a and b are merged together starting from a3 to a? It can be to a4 or a400 (while still all being merged with the respected column b). I need to unmerge these two columns and then take column c and column d and paste them into the Newley unmerged column b. Then I would auto fit column c.


Would it be easier to do the entire columns instead of creating ranges?
 
Upvote 0
Range("A3:C77).Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.Addindent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder - xlContext
.MergeCells = True
End With



'And then this goes on 49 more times for each of the cells in column a that contains text on the final one it says the following:

Selection.Unmerge
Range("C3:D77").Select
Selection.Cut
Range("B3").Select
ActiveSheet.Paste
Columns("C:C").Entirecolumn.Autofit
End Sub



'I tried doing the entire columns but the first three rows are held for titles of the table so i need to create 2 ranges i believe. the first is from A3 to B? and unmerge those cells.

'The next range would be from C3 to D? then cut and paste that range to column B. OR Delete Column B as you said, which would then move them all over to the left. Any Suggestions?

'Thank you very much for your help on this i really appreciate it.
 
Upvote 0
If you want to select columns A:C excluding the first 2 rows:

Code:
Columns("A:C").Resize(Rows.Count - 2).Offset(2).Select
 
Upvote 0

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