VB counter, get data from cell












0














I have problem that in this line that i dont get right value



<pre>strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"<code>


this should choose the right date(right cell) in my excel calendar, but it doesnt. Here is part of picture of my calendar enter image description here
Where is word "value" with an "X" in cell next to it. I should get value from this cell. For example (look pricture) for cell B5 I should get "value3"



    For i = 3 To 33
'---Rows---

For j = 1 To 12
'---Columns---

For leto = year(Date) - 1 To year(Date) + 1
mesec = (j * 3) - 1
strASCX = strASCX & "if (e.Day.Date.Year == " & leto & "){if (e.Day.Date.Month == " & j & "){if (e.Day.Date.Day ==" & i - 2 & "){aLabel.Text ="""

If Sheets(1).Cells(2, mesec + 1) = leto Then
If Trim(Sheets(1).Cells(i, mesec)) <> vbNullString Then
status = UCase(Trim(Sheets(1).Cells(i, mesec + 1)))
Select Case status
Case Is = "X"
strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"
End Select
End If
End If

strASCX = strASCX & """;" & "aLabel.ForeColor = System.Drawing.ColorTranslator.FromHtml(""#ccccc2""); e.Cell.Controls.Add(aLabel); }} }" & vbNewLine
Next leto
Next j
Next i









share|improve this question
























  • What does it get? What is the value of mesec when it fails? Use the actual sheet name as well rather than position. And what is the value of i and j? Are they as expected? Step through with F8.
    – QHarr
    Nov 12 '18 at 8:57












  • thanks, can u tell me how can i check values for i and j counter step by step by pressing F8
    – patriot16
    Nov 12 '18 at 9:06










  • you could highlight each variable and right-click add watch > break on change in value (delete the watches later); or I prefer generally to insert the word STOP on a separate line just before the variables you are interested in then press F8 to execute code line by line, you can then hover over variables to see their values (just after you execute the line containing them), or inspect in the locals window.
    – QHarr
    Nov 12 '18 at 9:08












  • okay counting is wrong. Code read good from calendar cells, but values that code got aren't from right cells like every cell have delay. but this delay is random. There is no delay patern that I could follow
    – patriot16
    Nov 12 '18 at 12:12












  • Delay? What does that mean ?
    – QHarr
    Nov 12 '18 at 12:24
















0














I have problem that in this line that i dont get right value



<pre>strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"<code>


this should choose the right date(right cell) in my excel calendar, but it doesnt. Here is part of picture of my calendar enter image description here
Where is word "value" with an "X" in cell next to it. I should get value from this cell. For example (look pricture) for cell B5 I should get "value3"



    For i = 3 To 33
'---Rows---

For j = 1 To 12
'---Columns---

For leto = year(Date) - 1 To year(Date) + 1
mesec = (j * 3) - 1
strASCX = strASCX & "if (e.Day.Date.Year == " & leto & "){if (e.Day.Date.Month == " & j & "){if (e.Day.Date.Day ==" & i - 2 & "){aLabel.Text ="""

If Sheets(1).Cells(2, mesec + 1) = leto Then
If Trim(Sheets(1).Cells(i, mesec)) <> vbNullString Then
status = UCase(Trim(Sheets(1).Cells(i, mesec + 1)))
Select Case status
Case Is = "X"
strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"
End Select
End If
End If

strASCX = strASCX & """;" & "aLabel.ForeColor = System.Drawing.ColorTranslator.FromHtml(""#ccccc2""); e.Cell.Controls.Add(aLabel); }} }" & vbNewLine
Next leto
Next j
Next i









share|improve this question
























  • What does it get? What is the value of mesec when it fails? Use the actual sheet name as well rather than position. And what is the value of i and j? Are they as expected? Step through with F8.
    – QHarr
    Nov 12 '18 at 8:57












  • thanks, can u tell me how can i check values for i and j counter step by step by pressing F8
    – patriot16
    Nov 12 '18 at 9:06










  • you could highlight each variable and right-click add watch > break on change in value (delete the watches later); or I prefer generally to insert the word STOP on a separate line just before the variables you are interested in then press F8 to execute code line by line, you can then hover over variables to see their values (just after you execute the line containing them), or inspect in the locals window.
    – QHarr
    Nov 12 '18 at 9:08












  • okay counting is wrong. Code read good from calendar cells, but values that code got aren't from right cells like every cell have delay. but this delay is random. There is no delay patern that I could follow
    – patriot16
    Nov 12 '18 at 12:12












  • Delay? What does that mean ?
    – QHarr
    Nov 12 '18 at 12:24














0












0








0







I have problem that in this line that i dont get right value



<pre>strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"<code>


this should choose the right date(right cell) in my excel calendar, but it doesnt. Here is part of picture of my calendar enter image description here
Where is word "value" with an "X" in cell next to it. I should get value from this cell. For example (look pricture) for cell B5 I should get "value3"



    For i = 3 To 33
'---Rows---

For j = 1 To 12
'---Columns---

For leto = year(Date) - 1 To year(Date) + 1
mesec = (j * 3) - 1
strASCX = strASCX & "if (e.Day.Date.Year == " & leto & "){if (e.Day.Date.Month == " & j & "){if (e.Day.Date.Day ==" & i - 2 & "){aLabel.Text ="""

If Sheets(1).Cells(2, mesec + 1) = leto Then
If Trim(Sheets(1).Cells(i, mesec)) <> vbNullString Then
status = UCase(Trim(Sheets(1).Cells(i, mesec + 1)))
Select Case status
Case Is = "X"
strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"
End Select
End If
End If

strASCX = strASCX & """;" & "aLabel.ForeColor = System.Drawing.ColorTranslator.FromHtml(""#ccccc2""); e.Cell.Controls.Add(aLabel); }} }" & vbNewLine
Next leto
Next j
Next i









share|improve this question















I have problem that in this line that i dont get right value



<pre>strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"<code>


this should choose the right date(right cell) in my excel calendar, but it doesnt. Here is part of picture of my calendar enter image description here
Where is word "value" with an "X" in cell next to it. I should get value from this cell. For example (look pricture) for cell B5 I should get "value3"



    For i = 3 To 33
'---Rows---

For j = 1 To 12
'---Columns---

For leto = year(Date) - 1 To year(Date) + 1
mesec = (j * 3) - 1
strASCX = strASCX & "if (e.Day.Date.Year == " & leto & "){if (e.Day.Date.Month == " & j & "){if (e.Day.Date.Day ==" & i - 2 & "){aLabel.Text ="""

If Sheets(1).Cells(2, mesec + 1) = leto Then
If Trim(Sheets(1).Cells(i, mesec)) <> vbNullString Then
status = UCase(Trim(Sheets(1).Cells(i, mesec + 1)))
Select Case status
Case Is = "X"
strASCX = strASCX & "<br><font color=red> " & Sheets(1).Cells(i, j).Value & " </font>"
End Select
End If
End If

strASCX = strASCX & """;" & "aLabel.ForeColor = System.Drawing.ColorTranslator.FromHtml(""#ccccc2""); e.Cell.Controls.Add(aLabel); }} }" & vbNewLine
Next leto
Next j
Next i






excel vb.net






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 13:45









Cindy Meister

14.2k102134




14.2k102134










asked Nov 12 '18 at 8:53









patriot16

13




13












  • What does it get? What is the value of mesec when it fails? Use the actual sheet name as well rather than position. And what is the value of i and j? Are they as expected? Step through with F8.
    – QHarr
    Nov 12 '18 at 8:57












  • thanks, can u tell me how can i check values for i and j counter step by step by pressing F8
    – patriot16
    Nov 12 '18 at 9:06










  • you could highlight each variable and right-click add watch > break on change in value (delete the watches later); or I prefer generally to insert the word STOP on a separate line just before the variables you are interested in then press F8 to execute code line by line, you can then hover over variables to see their values (just after you execute the line containing them), or inspect in the locals window.
    – QHarr
    Nov 12 '18 at 9:08












  • okay counting is wrong. Code read good from calendar cells, but values that code got aren't from right cells like every cell have delay. but this delay is random. There is no delay patern that I could follow
    – patriot16
    Nov 12 '18 at 12:12












  • Delay? What does that mean ?
    – QHarr
    Nov 12 '18 at 12:24


















  • What does it get? What is the value of mesec when it fails? Use the actual sheet name as well rather than position. And what is the value of i and j? Are they as expected? Step through with F8.
    – QHarr
    Nov 12 '18 at 8:57












  • thanks, can u tell me how can i check values for i and j counter step by step by pressing F8
    – patriot16
    Nov 12 '18 at 9:06










  • you could highlight each variable and right-click add watch > break on change in value (delete the watches later); or I prefer generally to insert the word STOP on a separate line just before the variables you are interested in then press F8 to execute code line by line, you can then hover over variables to see their values (just after you execute the line containing them), or inspect in the locals window.
    – QHarr
    Nov 12 '18 at 9:08












  • okay counting is wrong. Code read good from calendar cells, but values that code got aren't from right cells like every cell have delay. but this delay is random. There is no delay patern that I could follow
    – patriot16
    Nov 12 '18 at 12:12












  • Delay? What does that mean ?
    – QHarr
    Nov 12 '18 at 12:24
















What does it get? What is the value of mesec when it fails? Use the actual sheet name as well rather than position. And what is the value of i and j? Are they as expected? Step through with F8.
– QHarr
Nov 12 '18 at 8:57






What does it get? What is the value of mesec when it fails? Use the actual sheet name as well rather than position. And what is the value of i and j? Are they as expected? Step through with F8.
– QHarr
Nov 12 '18 at 8:57














thanks, can u tell me how can i check values for i and j counter step by step by pressing F8
– patriot16
Nov 12 '18 at 9:06




thanks, can u tell me how can i check values for i and j counter step by step by pressing F8
– patriot16
Nov 12 '18 at 9:06












you could highlight each variable and right-click add watch > break on change in value (delete the watches later); or I prefer generally to insert the word STOP on a separate line just before the variables you are interested in then press F8 to execute code line by line, you can then hover over variables to see their values (just after you execute the line containing them), or inspect in the locals window.
– QHarr
Nov 12 '18 at 9:08






you could highlight each variable and right-click add watch > break on change in value (delete the watches later); or I prefer generally to insert the word STOP on a separate line just before the variables you are interested in then press F8 to execute code line by line, you can then hover over variables to see their values (just after you execute the line containing them), or inspect in the locals window.
– QHarr
Nov 12 '18 at 9:08














okay counting is wrong. Code read good from calendar cells, but values that code got aren't from right cells like every cell have delay. but this delay is random. There is no delay patern that I could follow
– patriot16
Nov 12 '18 at 12:12






okay counting is wrong. Code read good from calendar cells, but values that code got aren't from right cells like every cell have delay. but this delay is random. There is no delay patern that I could follow
– patriot16
Nov 12 '18 at 12:12














Delay? What does that mean ?
– QHarr
Nov 12 '18 at 12:24




Delay? What does that mean ?
– QHarr
Nov 12 '18 at 12:24












0






active

oldest

votes











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53258641%2fvb-counter-get-data-from-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
















draft saved

draft discarded




















































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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53258641%2fvb-counter-get-data-from-cell%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Full-time equivalent

Bicuculline

さくらももこ