How do I?

Tarqs

Board Regular
Joined
Feb 14, 2011
Messages
120
I have a report which contains a list of other report names in column A. I need to be able to paste part of this name into Column D. The report name will always be in this format DPS11/895/Ret/KC. I need to be able to paste the 895 to Column D.

Help is greatfully received.

Tarqs
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
First, click on the cell containing the info you want to copy. Then in the formula bar [appears as a textbox above your worksheet and under the menus] hightlight just that portion that you want to copy, hit Ctrl and 'C' keys simultaneously to copy. Then click on cell in column D and hit Ctrl and 'V' keys simultaneously to paste.
 
Upvote 0
Apologies I wasn't clear. I need to do this on mass. I have approximately 200 rows of information and report changes on a weekly basis.
 
Upvote 0
If your data starts in cell A1 use the formula:

=MID(A1,7,3)

EDIT - To give a bit more information, A1 refers to the cell, 7 is the number of characters from the left hand side and 3 is the number of characters you wish to show

:)
 
Upvote 0
Tarqs,


Sample raw data for lasgt week, before the macro:


Excel Workbook
ABCD
1Report NameTitle BTitle CReport #
2DPS11/892/Ret/KC22
3DPS11/893/Ret/KC33
4DPS11/894/Ret/KC44
5
6
7
8
Sheet1





After the macro:


Excel Workbook
ABCD
1Report NameTitle BTitle CReport #
2DPS11/892/Ret/KC22892
3DPS11/893/Ret/KC33893
4DPS11/894/Ret/KC44894
5
6
7
8
Sheet1





Then you add some new data:


Excel Workbook
ABCD
1Report NameTitle BTitle CReport #
2DPS11/892/Ret/KC22892
3DPS11/893/Ret/KC33893
4DPS11/894/Ret/KC44894
5DPS11/895/Ret/KC55
6DPS11/8951/Ret/KC67
7DPS11/895123/Ret/KC67
8
Sheet1





And, run the macro again:


Excel Workbook
ABCD
1Report NameTitle BTitle CReport #
2DPS11/892/Ret/KC22892
3DPS11/893/Ret/KC33893
4DPS11/894/Ret/KC44894
5DPS11/895/Ret/KC55895
6DPS11/8951/Ret/KC678951
7DPS11/895123/Ret/KC67895123
8
Sheet1





Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
2. Open your workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


Code:
Option Explicit
Sub ExtractReportNbr()
' hiker95, 04/11/2011
' http://www.mrexcel.com/forum/showthread.php?t=542626
Dim LR As Long, FR As Long, a As Long
Dim Sp
Application.ScreenUpdating = False
LR = Cells(Rows.Count, "A").End(xlUp).Row
FR = Range("D" & Rows.Count).End(xlUp).Offset(1).Row
For a = FR To LR Step 1
  Sp = Split(Cells(a, 1), "/")
  Cells(a, "D") = Sp(1)
Next a
Application.ScreenUpdating = True
End Sub


Then run the ExtractReportNbr macro.
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,704
Members
452,938
Latest member
babeneker

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