Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

inserting line and keeping formulas


  • Please log in to reply

#1
bemiddy

bemiddy

    New Member

  • Member
  • Pip
  • 5 posts
hey all
Id like to insert a line into excel and i would like it to auto fill somehow with the proper formula. like the cells around

is that possible to insert a line with it being already formatted?
thanks
  • 0

Advertisements


#2
Octagonal

Octagonal

    Member 2k

  • Member
  • PipPipPipPipPip
  • 2,528 posts
It depends on exactly what you are after. There are several ways to do this. It is possible to simply insert the row and then copy and paste (formula) from a previous row or you can achieve this by writing VBA code to do the whole thing automatically. You have to consider things like cell reference (relative or absolute) etc.

HTH
"O"
  • 0

#3
bemiddy

bemiddy

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts

It depends on exactly what you are after. you can achieve this by writing VBA code to do the whole thing automatically. You have to consider things like cell reference (relative or absolute) etc.



how would I do it with vba code?
  • 0

#4
Octagonal

Octagonal

    Member 2k

  • Member
  • PipPipPipPipPip
  • 2,528 posts
Are you familiar with VBA coding? If you aren't, writing code for what you are asking in your first post can be a little tricky.

Below is an sample of code to insert a row.

Sub InsertRow()
Dim NumOfRows
NumOfRows = InputBox("Enter the number of rows required to be inserted.")
Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(NumOfRows - 1, 0)).Select
Selection.EntireRow.Insert
End Sub

Here is a good example of the code for inserting rows and formulas.

I wont go into coding any further here as that topic belongs in the Programming sub- forum.

HTH
"O"
  • 0

#5
bemiddy

bemiddy

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
thanks
that site really helped!!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP