Excel VBA function that can recalculate on scroll - excel

I am trying to find a way to detect scrolling in Excel since its not possible out of the box and I used the following macro to check the row number of the top left visible cell in the active window:
Function Scroll() As Double
Scroll = ActiveWindow.ScrollRow
End Function
So in excel if I paste the formula =Scroll() into any cell, it actually gives me the top visible cell row. When I scroll it doesn't update but if i click on the cell, then click on formula bar and press Enter it then updates again. Is there a way around this or that's just a limitation in Excel.

Related

If Vlookup formula can remain there even after running a Macro

I have made a Data Entry form in which i have recorded a macro Using "Use Relative Reference" from developers tab.
I have also added vlookup formula so that if a certain value or word is selected many of the fields being pulled or appears automatically.
I have created a button named as "Save Data" and have recorded a macro in it
After adding all the values (few values manually, few values I pull via Vlookup) whenever i press the button "Save Data" it moves the all values from data entry form to another Main Worksheet.
However the problem is whenever i press the button it also removes the formula of Vlookup and I have to either paste Vlookup formula again or add the values manually. the formula of Vlookup is
=VLOOKUP(C12,Functions!F$2:J$20,3,0)
Can anyone suggest if even after pressing the button and after moving the data the formula should remain there and i do not have to put them manually again and again

Jump to Active Cell with Hyperlink Formula

I've got a very horizontally long worksheet and I've created hyperlinks using the hyperlink formula and a match formula that matches to section headings. I've found some VBA code that jumps the window to the active cell but I can only get this to work if hyperlink cells using the (ctrl+k) method. Is there a way to jump the window to the active cell following a link from the hyperlink formula?
Original reference I've been using. Excel Hyperlink - jump to cell and scroll window
Thanks!

Excel VBA: Connect Scrollbar and Textbox in Userform

I have a userform with a scrollbar and textbox.
How do you code it so that the scrollbar connects to the textbox?
For example, I want the textbox to increase/decrease by a value each time you click the up/down-arrow on the scrollbar.
You don't say what version of Excel you are using so see if this works for you.
To get a spinner or scrollbar to work you can connect it to a cell by right-clicking on the scroll bar control and selecting Properties | Format Control | Control and then select the cell by using the Cell Link property at the bottom to select and link the cell you want to increment/decrement by using the scrollbar
If you haven't already linked the textbox to that cell, you can do so by
First - select the text box
Second - put your cursor in the formula bar
Third - type in = symbol and then click on the above cell you want
to link to,
Finally - press the Enter key

How to select range cell with VBA and align to top instead to the middle of the window?

I created a hiperlink, but this is not working correctly. When the vba is executed, always the selected cell is in the middle of the window, i want to align the selected cell to the top left in window with any resolution. This for navigation on the document. My excel is 2010.
Add the following line of code after you make the cell into a hyperlink:
Application.Goto Cells(1,1),TRUE
Replace Cells(1,1) with the appropriate cell.

Picture shows in excel if a threshold is hit

I am creating an excel spreadsheet to track sales quota. I would like the spreadsheet to display a picture of fireworks when quota is hit. I don't know that much about macros, but good with formulas but that doesn't seem to help. Any ideas?
One way that I know it can be done:
1) Paste the picture of the fireworks in a cell (say A1) in a separate (preferably hidden sheet). Make sure to resize the cell (or the picture) so that the picture completely fits inside cell A1.
2) Define a named formula, maybe named "fireworks", which goes like:
=IF([Your condition for the fireworks to show],INDIRECT("[cell in which firework pic is]"),INDIRECT("[any blank cell"))
like for eg:
=IF(Sheet1!$C$6=TRUE,INDIRECT("Sheet2!$a$1"),INDIRECT("Sheet1!$M$8"))
3) Go to 'Insert' tab, click Object, click bitmap image. If paint or any image editor opens up just close it, so it inserts a blank image/object into the sheet. This image will have "=EMBED("Paint.Picture","")" in the formula bar. Replace this with a reference to our named formula, like =fireworks
4) Resize and reposition this image/object. When the condition is satisfied, the pic should pop up.

Resources