Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Merging cells in excel report in VB/MSaccess

Posted on 2008-10-28
2
Medium Priority
?
214 Views
Last Modified: 2013-11-25
Hi
I am creating a report in my access application and need to merge cells in the report the following code won't work the syntax is wrong help much appreciated. The output is dependant on the number of records so i must use nStock code to denote increment in records.
The original code
 wsOrder.Range("c" & nStkCode).value = recEquipment.Fields("Description") is not suitable as the record overflows. I tried this to merge the cells but getting error.

wsOrder.Range("C"& nStkCode ": E"& nStkCode).MergeCells = True
Thanks
mbsparrow
0
Comment
Question by:mbsparrow
2 Comments
 
LVL 23

Accepted Solution

by:
irudyk earned 2000 total points
ID: 22827174
The syntax seems a bit off, try using:
wsOrder.Range("C" & nStkCode & ": E" & nStkCode).MergeCells = True
0
 

Author Closing Comment

by:mbsparrow
ID: 31510664
Thanks a million that did it.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question