Mannyto

New Member
Joined
Nov 17, 2017
Messages
2
Hello everyone,

I am looking for a way to run this macro on a determined starting point not only on "m3137" but for example if I am in "A3194". It may be worth to mention that I added blank rows to make navigation easier and to have a cell to do the sum.

This is the code I used:
Sub AddBlankRows()
'
Dim iRow As Integer, iCol As Integer
Dim oRng As Range


Set oRng = Range("g2")


iRow = oRng.Row
iCol = oRng.Column


Do
'
If Cells(iRow + 1, iCol) <> Cells(iRow, iCol) Then
Cells(iRow + 1, iCol).EntireRow.Insert shift:=xlDown
iRow = iRow + 2
Else
iRow = iRow + 1
End If
'
Loop While Not Cells(iRow, iCol).Text = ""
'
End Sub



Thanks in advance

Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range("M3137:W3193").Select
Range("M3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("N3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("O3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("P3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("Q3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("R3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("S3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("T3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("U3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("V3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Range("W3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("M3137:W3193").Select
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range("Y3137:AE3193").Select
Range("Y3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Range("Z3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Range("AA3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Range("AB3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Range("AC3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Range("AD3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Range("AE3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-56]C:R[-1]C)"
Range("Y3137:AE3193").Select
Selection.End(xlToLeft).Select
Selection.End(xlToLeft).Select
Selection.End(xlToLeft).Select
Selection.End(xlToLeft).Select
Selection.End(xlDown).Select
Range("A3193").Select
Selection.End(xlToRight).Select
Range(Selection, Selection.End(xlToRight)).Select
Range("M3193:X3193").Select
Range("X3193").Activate
ActiveCell.FormulaR1C1 = "=SUM(RC[-11]:RC[-1])"
Rows("3193:3193").Select
Range("M3193").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.End(xlToLeft).Select
Selection.End(xlToLeft).Select
Range("A3194").Select
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Welcome to the Board!

I find your question, when coupled with your code, a bit confusing.
Can you just tell us in plain English exactly what you want to happen (what should this code be doing)?
 
Upvote 0
Hello yes, I'm trying to go to column m, select all the way to W and select down to the next line brake and autosum on the next availabe blank row, then go back to the start point and then go to column Y, select again all the way to AE, select down to the next line brake and autosum again on the same blank row previously mentioned, guess I could brake it into 2 different processes.

Hopefully this makes more sense.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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