I write Cobol format in VBA excel please help me with such as?

Faozan

Banned user
Joined
May 14, 2023
Messages
25
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Such as asdfghjk =>asd-fg-hijk (alphanumeric)
1234567 => 12-345-67 (numeric)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Sorry, but I don't know COBOL and have absolutely no idea, what you want to achieve.

Do you just want to separate text/number with dashes?
What is the COBOL format and how should the items be separated?

Please provide a little more information.
 
Upvote 0
Sorry, but I don't know COBOL and have absolutely no idea, what you want to achieve.

Do you just want to separate text/number with dashes?
What is the COBOL format and how should the items be separated?

Please provide a little more information.
I want to write to space with "-" for a separate integer and separate character such as
Value Cobal Format Data Type Data Length. Start Position End Position
xx-xxx-xx-xxxx-xxxx. 9(4) NUMERIC 4 1 4
 
Upvote 0
want to write to space with "-" for a separate integer and separate character such as
Value :
xx-xxx-xx-xxxx-xxxx.
Cobal Format :
9(4)
Data Type :
NUMERIC
Data Length :
4
Start Position :
1
End Position :
4
 
Upvote 0
Unfortunately I still don't understand what you need.

Could you describe it in a different way?
And give an example input/output.
 
Upvote 0
Unfortunately I still don't understand what you need.

Could you describe it in a different way?
And give an example input/output.
Input asdfggh Output asd-fg-gh by Conditional is start position : 1 and end position : 4.
 
Upvote 0
asdfghjk to asd-fg-hijk = 3, 2 and 4 characters (You must have missed the letter "i" in the before string)
1234567 to 12-345-67 = 2, 3 and 2 characters
xx-xxx-xx-xxxx-xxxx = 2, 3, 2, 4 and 4 characters
asdfggh to asd-fg-gh = 3, 2 and 2 characters
Is there a logic in it? The four examples you gave us are all different.
 
Upvote 0
asdfghjk to asd-fg-hijk = 3, 2 and 4 characters (You must have missed the letter "i" in the before string)
1234567 to 12-345-67 = 2, 3 and 2 characters
xx-xxx-xx-xxxx-xxxx = 2, 3, 2, 4 and 4 characters
asdfggh to asd-fg-gh = 3, 2 and 2 characters
Is there a logic in it? The four examples you gave us are all different.
Yes. please help me for example with these cases.
 
Upvote 0
If you answer the question first. What is the logic?
When do we split into 3, 2 and 4 and when into 2, 3 and 2 and when into 2, 3, 2, 4 and 4 and when into 3, 2 and 2 characters? And I assume there are others yet to come.
 
Upvote 0
If you answer the question first. What is the logic?
When do we split into 3, 2 and 4 and when into 2, 3 and 2 and when into 2, 3, 2, 4 and 4 and when into 3, 2 and 2 characters? And I assume there are others yet to come.
both characters and numeric.
the logic is a separate sheet then output sheet (A) equal to as-df-ghj and sheet(B) 1234-334-234.
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,946
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top