excel - how to lock ActiveX button to specific column index -


I have to lock an active column in a specific column index when clicked, the button runs VBA code Deletes three columns, and then when unchecked, VBA code essentially undo this past deletion, and then inserts 3 new columns.

The VBA code works fine. The problem is that the command button only keeps my sheet sliding down to three columns at a time, unless it is sitting at the top of my data.

I have tried to lock / unlock the button, but it does not make any difference.

I would like to know if there is any way that I can lock this command button instead of just one specific column in the specific column index . For example, I want to lock it into column index 10, which is column J. In this way, when the button becomes active and the rows are removed / replaced, the button is placed in the column in column 10.

These are before and after pictures of this problem: before

after

There is also VBA code which is run on every press (Not sure that it is relevant but I thought it could not hurt to include):

  Private sub-checkbox 1_Click () Dim Array1 () as string ' Creates a dynamic array, dim thermal worksheet Dim Ella Set the worksheet dim LastRow as the long set alias_edes = sheets ("alloy_ads") Find the last line in the sheet with the temp = sheets ("floating") sheet ("aliases_adsms") LastRow = .change ("b "And" rash.account "). (XLEEP). With 'End End', the declaration of the price of the last line of 'Andri' is about the value of the last line, if the start of the 'Red' Straight 'conditional teetems, checkboxes 1. Value = True, then stores values ​​from the cell in column F in column F. LastRow Array1 (i) = Alias_Adds.Cells (i, "F") for I = 1 prints the next I 'Array1 content (" F ") = Array1 (m) with the next Alias_Adds Alias_Adds.Range (" A: with "A, F: F, G: G"). Remove 'Allies Edish Columns' ("E: F"). Set the column on 'E': F because after A has been removed in line, the columns go to the left end with the end if 'and checkbox 1.Value = true boolean If statement, check box 1. Insert a new column on the left side of column A in the Value = False "Alliance_ads sheet AIS_ads column". "A: A". Shift: Enter the Shift: XlToRight, CopyOrigin: for loop for 'xlFormatFromLeftOrAbove' In the newly inserted column print the verification work in an alias_ed.sege ("A, F: F, G: G") Internal color = RGB (192, 192, 192) surname column (" A "). Number format =" normal "column to set the format of the format to normal Print the function for the loop; LastRow for j = 1 if (j> 1) then the alias_directory. Seals (J, "A") = "= B" & amp; J & amp; "And C" & amp; J & amp; "& Amp; D" & amp; J Esse: Alias_Adus Seals (J, "A") = "Concertate Function" and if next column to 'Jpeg', to print the loop to store the cells in the cell in the column 'Last' for the K = 1, Alias_Adds .Kells (Kashmir, "F") = Temp.Cells (k, "F") for the next loop '' column g alias_ed.s To print the verification work in the columns ("G"). LastRow for L = 1 to print the loop function for the number format before calling normal for the "normal" "number format" column (L> 1) then alias_addsh seals (L, "g") = "= COUNTIF (A: A, A" & amp; & amp; amp; & amp; amp; & amp; l & amp;;) "Other: Elias_Adoo. Seals (L, "G") = "Duplicate Check?" End if the next L & end box '1' value = incorrect boolean statement and all  

You can try to do something like this, the worksheet_stream event is triggered whenever the command button takes you to a fixed point:

  Private sub worksheet_check (Targeted by Range) by CommandButton1 .Left = 216.75 End All  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -