Border Line on last cell even if it is null/empty cell
I have a problem in this part in creating a border line for each row to last cell.
it works well if the last cell has a value. but the border lines stop when the last cell is empty.
here's my code
lastcell = Cells(Rows.Count, 19).End(xlUp).Address
lastrow = Cells(Rows.Count, 19).End(xlUp).Row
Rng = "A11:" & lastcell
Range(Rng).Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeBottom).Weight = xlThin
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeRight).Weight = xlThin
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).Weight = xlThin
.VerticalAlignment = xlCenter
.WrapText = True
End With
I want it to still add continuous border line until the last data value even if the last cell of the row is empty..
thank you.
microsoft-excel vba macros
add a comment |
I have a problem in this part in creating a border line for each row to last cell.
it works well if the last cell has a value. but the border lines stop when the last cell is empty.
here's my code
lastcell = Cells(Rows.Count, 19).End(xlUp).Address
lastrow = Cells(Rows.Count, 19).End(xlUp).Row
Rng = "A11:" & lastcell
Range(Rng).Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeBottom).Weight = xlThin
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeRight).Weight = xlThin
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).Weight = xlThin
.VerticalAlignment = xlCenter
.WrapText = True
End With
I want it to still add continuous border line until the last data value even if the last cell of the row is empty..
thank you.
microsoft-excel vba macros
You are looking for a value in column S to determine the lastrow. If it were blank it wouldn't be the lastrow. Perhaps you want to look at a different column for determining that?
– datatoo
Jan 28 at 20:50
how am I going to do it? since my last column is S. I've already tried to use "lastrow" instead of "lastcell" but it gives me error. I don't know what command will I going to use for it to continuously add border line even if the last cell is blank. I'm sorry I'm new at VBA macro
– gee
Jan 29 at 7:04
If S can be blank, but another cell will always have a value, such as A, then you can determine the lastrow by looking at A, but format S even if it is blank. Is that possibly true in this situation?
– datatoo
Jan 29 at 15:01
add a comment |
I have a problem in this part in creating a border line for each row to last cell.
it works well if the last cell has a value. but the border lines stop when the last cell is empty.
here's my code
lastcell = Cells(Rows.Count, 19).End(xlUp).Address
lastrow = Cells(Rows.Count, 19).End(xlUp).Row
Rng = "A11:" & lastcell
Range(Rng).Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeBottom).Weight = xlThin
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeRight).Weight = xlThin
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).Weight = xlThin
.VerticalAlignment = xlCenter
.WrapText = True
End With
I want it to still add continuous border line until the last data value even if the last cell of the row is empty..
thank you.
microsoft-excel vba macros
I have a problem in this part in creating a border line for each row to last cell.
it works well if the last cell has a value. but the border lines stop when the last cell is empty.
here's my code
lastcell = Cells(Rows.Count, 19).End(xlUp).Address
lastrow = Cells(Rows.Count, 19).End(xlUp).Row
Rng = "A11:" & lastcell
Range(Rng).Select
With Selection
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeLeft).Weight = xlThin
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeTop).Weight = xlThin
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeBottom).Weight = xlThin
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeRight).Weight = xlThin
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlThin
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).Weight = xlThin
.VerticalAlignment = xlCenter
.WrapText = True
End With
I want it to still add continuous border line until the last data value even if the last cell of the row is empty..
thank you.
microsoft-excel vba macros
microsoft-excel vba macros
asked Jan 28 at 0:49
geegee
214
214
You are looking for a value in column S to determine the lastrow. If it were blank it wouldn't be the lastrow. Perhaps you want to look at a different column for determining that?
– datatoo
Jan 28 at 20:50
how am I going to do it? since my last column is S. I've already tried to use "lastrow" instead of "lastcell" but it gives me error. I don't know what command will I going to use for it to continuously add border line even if the last cell is blank. I'm sorry I'm new at VBA macro
– gee
Jan 29 at 7:04
If S can be blank, but another cell will always have a value, such as A, then you can determine the lastrow by looking at A, but format S even if it is blank. Is that possibly true in this situation?
– datatoo
Jan 29 at 15:01
add a comment |
You are looking for a value in column S to determine the lastrow. If it were blank it wouldn't be the lastrow. Perhaps you want to look at a different column for determining that?
– datatoo
Jan 28 at 20:50
how am I going to do it? since my last column is S. I've already tried to use "lastrow" instead of "lastcell" but it gives me error. I don't know what command will I going to use for it to continuously add border line even if the last cell is blank. I'm sorry I'm new at VBA macro
– gee
Jan 29 at 7:04
If S can be blank, but another cell will always have a value, such as A, then you can determine the lastrow by looking at A, but format S even if it is blank. Is that possibly true in this situation?
– datatoo
Jan 29 at 15:01
You are looking for a value in column S to determine the lastrow. If it were blank it wouldn't be the lastrow. Perhaps you want to look at a different column for determining that?
– datatoo
Jan 28 at 20:50
You are looking for a value in column S to determine the lastrow. If it were blank it wouldn't be the lastrow. Perhaps you want to look at a different column for determining that?
– datatoo
Jan 28 at 20:50
how am I going to do it? since my last column is S. I've already tried to use "lastrow" instead of "lastcell" but it gives me error. I don't know what command will I going to use for it to continuously add border line even if the last cell is blank. I'm sorry I'm new at VBA macro
– gee
Jan 29 at 7:04
how am I going to do it? since my last column is S. I've already tried to use "lastrow" instead of "lastcell" but it gives me error. I don't know what command will I going to use for it to continuously add border line even if the last cell is blank. I'm sorry I'm new at VBA macro
– gee
Jan 29 at 7:04
If S can be blank, but another cell will always have a value, such as A, then you can determine the lastrow by looking at A, but format S even if it is blank. Is that possibly true in this situation?
– datatoo
Jan 29 at 15:01
If S can be blank, but another cell will always have a value, such as A, then you can determine the lastrow by looking at A, but format S even if it is blank. Is that possibly true in this situation?
– datatoo
Jan 29 at 15:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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%2fsuperuser.com%2fquestions%2f1399074%2fborder-line-on-last-cell-even-if-it-is-null-empty-cell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1399074%2fborder-line-on-last-cell-even-if-it-is-null-empty-cell%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
You are looking for a value in column S to determine the lastrow. If it were blank it wouldn't be the lastrow. Perhaps you want to look at a different column for determining that?
– datatoo
Jan 28 at 20:50
how am I going to do it? since my last column is S. I've already tried to use "lastrow" instead of "lastcell" but it gives me error. I don't know what command will I going to use for it to continuously add border line even if the last cell is blank. I'm sorry I'm new at VBA macro
– gee
Jan 29 at 7:04
If S can be blank, but another cell will always have a value, such as A, then you can determine the lastrow by looking at A, but format S even if it is blank. Is that possibly true in this situation?
– datatoo
Jan 29 at 15:01