473,811 Members | 3,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Merge cell in Excel programmaticall y

2 New Member
HI,

i need to merger two cells if the values is exceeds the width of the cells.

for example i have string like "Internet" so it will fir in single cell. if have string like"Internet protected level is off" for this i need merge the automatically i dont want wrap with the same

can any one provide solution for this.
thanks in advance
Aug 19 '11 #1
2 9733
R MacDonald
24 New Member
Hello, Nagarajan,

Here is a simple example. I hope this gives you an idea about how to proceed.

Dim xlaTest As New Excel.Applicati on
xlaTest.Visible = True
Dim wbkTest As Excel.Workbook = xlaTest.Workboo ks.Open("D:\Tes ts\VB Trials\ExcelTes ts\TestWorkbook .xls")
Dim wshTest As Excel.Worksheet = DirectCast(wbkT est.Worksheets( "Sheet1"), Excel.Worksheet )

wshTest.Range(" F3:G3").MergeCe lls = True

Cheers,
Randy
Aug 20 '11 #2
Nagarajan Venu
2 New Member
HI Randy

I already found the solution.
thanks for your effort
Aug 22 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
5682
by: middletree | last post by:
What ASP code can I use, for an ASP-generated spreadsheet, to force a cell to wrap if the content is longer than the width I have specified for that cell?
4
1754
by: Mark C | last post by:
I currently have an Excel spreadsheet with numerous text boxes and check boxes that I want to populate with data from an Access 97 database. I have used Excel automation in Access before but only to update cells not controls like text boxes. Can someone steer me onto the correct path? I am not using a VBA form in Excel it is just merely various text boxes and checkboxes placed on a worksheet. Any help would be much appreciated.
0
1816
by: Thomas | last post by:
Hey All, I am doing a mail merge with Excel and C#, the problem i am having is that my excel workbook has 5 worksheets in it. Is there a way to set which sheet the mail merghe should use. As it stands right now i get a pop up to select what sheet to use, which defeats the purpose of the automation. The Only property i found was as follows, wrdMailMerge.DataSource.TableName = table_name;
1
36579
by: GG | last post by:
Have this code but does not delete right columns. When I ran the folllowing code only columns 14, and 15 is deleted.Col 12 and 13 are still there. Any ideas? Thanks for (int colDel = 12; colDel <= 15; colDel++) { columnDelete(ref objSheet,colDel); }
1
1595
by: Samuel Shulman | last post by:
Any method to make a cell editable programmatically The problem is that if the user entered a value which is not valid then instead of ignoring the value and explaining the user what was wrong want to give them another chance to modify the value which they have entered Thanks, Samuel
0
1029
by: oaksong | last post by:
Splitting cells is common to every IDE that manipulates HTML that I've worked with. I'm appalled that .NET seems incapable of providing that funcitonality. There was a conversation last December on this topic with an Microsoft comment that it was 'ambiguous'. It's not. Leave current content in the 'old' cell and let the user do with it as they will after the 'new' cell is in place. Not being able to split cells creates HUGE headaches for...
6
2074
by: Gunawan | last post by:
Dear All, I have create an excel (COM Object) using this code Excel.Application xls = new Excel.Application(); but I can not remove it from memory although I have using close and quit wb.Close(false, false, 0); xls.Quit();
1
1928
by: Dranizz | last post by:
I want to set the value of a cell in a datagridview. DatagridView.CurrentRow.Cells(CEllName).value = "Blabla" When I do this in code and when it's the first cell I edit in a new row, it does not Bind to a new datarow. DatagridView.CurrentRow.DataBoundItem is nothing A new row is added only if I type (keyboard) anything in the cell, but programmatically, it does not add the row. How can I tell the datagridview, in code, that it must...
3
1703
by: Tequilaman | last post by:
Here comes are real tricky one: I'm approaching a project that seems impossible at first sight. I want to merge an Excel list where I find who will get which kind of information by email, with a word based document (can be an Outlook draft as well) and use the email adress form the Excel list as receipant of one email each. The emails will be different for every adress! - There might be attachments as well, but the import routine for that is...
0
1142
by: Nico125 | last post by:
Good afternoon, I am trying to develop a macro to merge a Excel sheet to a PPT. At this stage, I can merge it only if the text is in a "Text Box" but not into a table in the PPT. Could you please advise me regarding the modification to do? You will find the worksheet and the PPT attach. I also would like to know if it is possible: to update the slides created via the macro without merging the document again (1) and to add a slide...
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9201
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.