Delete specific content in Excel
I have a list of data format shown below.
???m,"N0000001","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"N0000003","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"N0000004","????(M)","201407","201407","1.54956","1.54956"
???????Y,"N0000015","????(M)","201412","201412","0.95776","0.98891"
and I want to delete the 'N000000' these part. only leave the valid number. the output should like this
???m,"1","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"3","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"4","????(M)","201407","201407","1.54956","1.54956"
???????Y,"15","????(M)","201412","201412","0.95776","0.98891"
Does anyone know what kind of operation should I do?
excel vba excel-vba
add a comment |
I have a list of data format shown below.
???m,"N0000001","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"N0000003","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"N0000004","????(M)","201407","201407","1.54956","1.54956"
???????Y,"N0000015","????(M)","201412","201412","0.95776","0.98891"
and I want to delete the 'N000000' these part. only leave the valid number. the output should like this
???m,"1","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"3","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"4","????(M)","201407","201407","1.54956","1.54956"
???????Y,"15","????(M)","201412","201412","0.95776","0.98891"
Does anyone know what kind of operation should I do?
excel vba excel-vba
isregexan option ?
– Hamza Abdaoui
Nov 16 '18 at 9:18
1
If it's a fixed lengthN000000then Ctrl + H find and replace it... You can highlight the range to reduce potential impact elsewhere if it could occur.
– Glitch_Doctor
Nov 16 '18 at 9:30
add a comment |
I have a list of data format shown below.
???m,"N0000001","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"N0000003","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"N0000004","????(M)","201407","201407","1.54956","1.54956"
???????Y,"N0000015","????(M)","201412","201412","0.95776","0.98891"
and I want to delete the 'N000000' these part. only leave the valid number. the output should like this
???m,"1","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"3","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"4","????(M)","201407","201407","1.54956","1.54956"
???????Y,"15","????(M)","201412","201412","0.95776","0.98891"
Does anyone know what kind of operation should I do?
excel vba excel-vba
I have a list of data format shown below.
???m,"N0000001","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"N0000003","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"N0000004","????(M)","201407","201407","1.54956","1.54956"
???????Y,"N0000015","????(M)","201412","201412","0.95776","0.98891"
and I want to delete the 'N000000' these part. only leave the valid number. the output should like this
???m,"1","????(M)","201405","201405","0.57674","0.60831"
???{???Y,"3","????(M)","201402","201402","0.78170","0.68470"
?}???n?j?`??,"4","????(M)","201407","201407","1.54956","1.54956"
???????Y,"15","????(M)","201412","201412","0.95776","0.98891"
Does anyone know what kind of operation should I do?
excel vba excel-vba
excel vba excel-vba
edited Nov 16 '18 at 11:03
Pᴇʜ
24.9k63052
24.9k63052
asked Nov 16 '18 at 9:16
J.FengJ.Feng
15
15
isregexan option ?
– Hamza Abdaoui
Nov 16 '18 at 9:18
1
If it's a fixed lengthN000000then Ctrl + H find and replace it... You can highlight the range to reduce potential impact elsewhere if it could occur.
– Glitch_Doctor
Nov 16 '18 at 9:30
add a comment |
isregexan option ?
– Hamza Abdaoui
Nov 16 '18 at 9:18
1
If it's a fixed lengthN000000then Ctrl + H find and replace it... You can highlight the range to reduce potential impact elsewhere if it could occur.
– Glitch_Doctor
Nov 16 '18 at 9:30
is
regex an option ?– Hamza Abdaoui
Nov 16 '18 at 9:18
is
regex an option ?– Hamza Abdaoui
Nov 16 '18 at 9:18
1
1
If it's a fixed length
N000000 then Ctrl + H find and replace it... You can highlight the range to reduce potential impact elsewhere if it could occur.– Glitch_Doctor
Nov 16 '18 at 9:30
If it's a fixed length
N000000 then Ctrl + H find and replace it... You can highlight the range to reduce potential impact elsewhere if it could occur.– Glitch_Doctor
Nov 16 '18 at 9:30
add a comment |
2 Answers
2
active
oldest
votes
Try this.
Sub test()
Dim rngDB As Range
Dim Ws As Worksheet
Set Ws = ActiveSheet
Set rngDB = Ws.UsedRange
rngDB.Replace "N000000", ""
End Sub
add a comment |
your data list is very unclear. Assuming the data commening with N000000 is in an individual cell, the formula you could use would be:
for data in cell A1, place formula in cell B1:
with ';' as a delimiter:
=right(A1;LEN(A1)-LEN("N000000"))
with , as delimiter
=right(A1,LEN(A1)-LEN("N000000"))
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53334725%2fdelete-specific-content-in-excel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try this.
Sub test()
Dim rngDB As Range
Dim Ws As Worksheet
Set Ws = ActiveSheet
Set rngDB = Ws.UsedRange
rngDB.Replace "N000000", ""
End Sub
add a comment |
Try this.
Sub test()
Dim rngDB As Range
Dim Ws As Worksheet
Set Ws = ActiveSheet
Set rngDB = Ws.UsedRange
rngDB.Replace "N000000", ""
End Sub
add a comment |
Try this.
Sub test()
Dim rngDB As Range
Dim Ws As Worksheet
Set Ws = ActiveSheet
Set rngDB = Ws.UsedRange
rngDB.Replace "N000000", ""
End Sub
Try this.
Sub test()
Dim rngDB As Range
Dim Ws As Worksheet
Set Ws = ActiveSheet
Set rngDB = Ws.UsedRange
rngDB.Replace "N000000", ""
End Sub
answered Nov 16 '18 at 11:26
Dy.LeeDy.Lee
3,6721511
3,6721511
add a comment |
add a comment |
your data list is very unclear. Assuming the data commening with N000000 is in an individual cell, the formula you could use would be:
for data in cell A1, place formula in cell B1:
with ';' as a delimiter:
=right(A1;LEN(A1)-LEN("N000000"))
with , as delimiter
=right(A1,LEN(A1)-LEN("N000000"))
add a comment |
your data list is very unclear. Assuming the data commening with N000000 is in an individual cell, the formula you could use would be:
for data in cell A1, place formula in cell B1:
with ';' as a delimiter:
=right(A1;LEN(A1)-LEN("N000000"))
with , as delimiter
=right(A1,LEN(A1)-LEN("N000000"))
add a comment |
your data list is very unclear. Assuming the data commening with N000000 is in an individual cell, the formula you could use would be:
for data in cell A1, place formula in cell B1:
with ';' as a delimiter:
=right(A1;LEN(A1)-LEN("N000000"))
with , as delimiter
=right(A1,LEN(A1)-LEN("N000000"))
your data list is very unclear. Assuming the data commening with N000000 is in an individual cell, the formula you could use would be:
for data in cell A1, place formula in cell B1:
with ';' as a delimiter:
=right(A1;LEN(A1)-LEN("N000000"))
with , as delimiter
=right(A1,LEN(A1)-LEN("N000000"))
answered Nov 16 '18 at 9:46
LambikLambik
500513
500513
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53334725%2fdelete-specific-content-in-excel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
is
regexan option ?– Hamza Abdaoui
Nov 16 '18 at 9:18
1
If it's a fixed length
N000000then Ctrl + H find and replace it... You can highlight the range to reduce potential impact elsewhere if it could occur.– Glitch_Doctor
Nov 16 '18 at 9:30