473,799 Members | 2,741 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 9732
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
36564
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
1593
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
2072
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
1702
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
9688
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
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
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...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4145
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
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.