• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

to select row and insert rows

ajaar

Member
Hi Friends,

I am trying to achieve a code to select the row from row number 25 till number of row mentioned in "G1", below is the code I made an attempt. Could any one guide me to get work this code. appreciated any help

Code:
Sub Insert_Rows()
  Dim num1 As Double
  Dim num2 As Double
 
  num1 = 25
  num2 = Range("G1").Value + 25
 
Rows(num1:num2).Select
  Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
  Range("F30").Select
End Sub
 
Last edited:
try this code;
Code:
Sub check()
Dim uservalue As Integer
uservalue = Range("G1").Value
Range("A25:" & "A" & CStr(uservalue)).EntireRow.Select
End Sub
 
Back
Top