473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Split cells in excel using VBA

20
I'm trying to split a product code into multiple cells but i'm not sure how to go about it. here is an example

(the product code is in A1)

A1=MST5F2

Here is what i want the output to look like

B1=MST
C1=5
D1=F
E1=2

so B1 will always be the first three digits and then beyond that it's 1 digit in every column the product code is always 6 digits.
May 3 '10 #1

✓ answered by MikeTheBike

Hi

B1=LEFT(A1,3)
C1=MID(A1,4,1)
D1=MID(A1,5,1)
E1=MID(A1,6,1)
or
E1=RIGHT(A1,1)

HTH


MTB

3 3024
MikeTheBike
639 Expert 512MB
Hi

B1=LEFT(A1,3)
C1=MID(A1,4,1)
D1=MID(A1,5,1)
E1=MID(A1,6,1)
or
E1=RIGHT(A1,1)

HTH


MTB
May 4 '10 #2
Guido Geurs
767 Expert 512MB
dear,

I hope this will help (see attachment)

br,
Attached Files
File Type: zip Split cells in excel using VBA_01.zip (6.5 KB, 179 views)
May 4 '10 #3
loudey
20
thanks a lot guys this, both solutions works. highly appreciated.
May 10 '10 #4

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

Similar topics

1
by: barma16 | last post by:
I've hit a bit of a brick wall here, and could use some advice. I have an Access application whose output is a four-tab Excel spreadsheet where three of the four tabs are the result of database...
1
by: Mark Goldin | last post by:
I am trying to split cells in a table. I am selecting a cell and I want to break into two. There is no "split" command available anywhere. What would you suggest?
1
by: Girish | last post by:
Hi, I want to embed a txt document into an excel using python. Here is my code, but i get an error message =================================================== Traceback (most recent call...
0
by: bebek_tetangga | last post by:
Hello, I'm trying to open a .txt file in Excel using C#. Here is my code: clsWorkbook = clsExcel.Workbooks.Open(dailyPath + "\\070701N.txt", 2, false, 5, "", "", true,...
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
0
by: wankhusairi | last post by:
hallo sir .. i am still new on using vb and i have tried to load an excel using a visual basic interface.. but if i wanted to plot my excel data what should i do.. must i cahnge my program on loading...
0
by: DJK | last post by:
Hi everyone, I have created a button in Excel using C#(without using Window form) and i want to perform certain actions on clicking that button. My code is as follows: ...
1
by: rameshmandapati | last post by:
hi i have a problem with Excel. iam adding data to a cell in Excel using java script var excel = new ActiveXObject ("Excel.Application"); but i want image also i search in google i...
1
by: =?Utf-8?B?U2hlZXMgQWJpZGk=?= | last post by:
I read an article on the link: http://support.microsoft.com/default.aspx?scid=kb;en-us;306572 related to reading data from Excel using OLEDB The topic's heading is: How to query and display excel...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.