-
Jan 1st, 2009, 07:12 PM
#1
Thread Starter
Fanatic Member
merging cells in excel
im trying to merge a cell in excel using the code below but it doesnt work or there is no reaction.. hope any one can help me w/ this
Code:
Selection.Cut Destination:=Range("G6")
Range("E6:G6").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Merge
-
Jan 1st, 2009, 08:40 PM
#2
Re: merging cells in excel
Did you get that code from recording a macro?
It shows ".MergeCells = False" which will not merge the selected cells.
Thread Moved
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010 
-
Jan 1st, 2009, 09:52 PM
#3
Thread Starter
Fanatic Member
Re: merging cells in excel
yes i got this to macro.. some code from macro works on creating an excel file?
-
Jan 2nd, 2009, 01:33 AM
#4
Re: merging cells in excel
You want to create an excel file now? But from where? Excel VBA or another programming language?
Create Excel Workbook
http://www.vbforums.com/showthread.php?t=442132
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Star Wars Gangsta Rap • Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Corsair H100i v2 water cooler, Geforce GTX1060, Samsung M.2 500 GB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2010, VS 2010 
-
Jan 2nd, 2009, 04:40 AM
#5
Re: merging cells in excel
The code posted in post 1 is absolutely correct to merge cells... Can you exactly explain...
1) Where are you running the code from?
2) Which sheet are you applying the merge in
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
Microsoft MVP: 2011 - 2015 IMP Links : Acceptable Use Policy, FAQ
MyGear:
ACER R7 (Win 8.1+Office 2013+VS2013) || Sony VPCCB-45FN with a Win10+Office 2010. || Mac Book Pro (10.6.8) with Office 2011
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|