Skip Cells

mef1sto

Board Regular
Joined
Oct 31, 2013
Messages
85
Hi guys and a Happy New Year!
Please give me a helping hand in this matter:

Code:
Public Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A7")) Is Nothing Then
    Dim lastc As String, j, firstc As String, sstep
    Dim i As Long, s As Long, e As Long
    firstc = InputBox("Fill in the first cell ex. A7")
    If Len(firstc) = 0 Then Exit Sub
        j = InputBox("First cell value, ex. 1 sau 3 etc.")
        lastc = InputBox("Last cell in asc order, ex. A10")
    If Len(lastc) = 0 Then Exit Sub
        sstep = InputBox("Value to increment cells ex. 1 sau 2 sau 3 sau cum doriti")
    Dim index As Integer
' ?? HERE I NEED ANOTHER OPTION TO SKIP UPON 1 OR MORE CELL AND ADD THE +1 INCREMENT OF THE VALUE 
    If Len(sstep) = 0 Then Exit Sub
        For i = 1 To e Step -1
        Range(firstc) = j '
        Range(firstc + i, lastc + i).DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=sstep, Trend:=False
        Next i
End If
End Sub
I would attach the .xlsm file but i donno how :(

Thanks for your aid! ;)
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,272
Messages
6,171,113
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top