#1   Report Post  
Frantic Excel-er
 
Posts: n/a
Default Macro Line Insert

I was wondering if it is possible to insert a line without a direct cell
reference.
This is exactly what I am trying to do...

I have import files that have many different lines...(each one is unique).
I wrote a macro to go thru the many tedious steps, except I am stuck on the
line insertion part....I do a data sort for column "C", and then I do a find
for "X" (which is a separation point). What I want to happen is for the
macro to find "X" and insert a line above it, regardless of which row "X" is
on. Is there a way to do that?

Thanks!!!
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Frantic,

Columns("C:C").Find(What:="X", _
LookIn:=xlValues, LookAt:=xlWhole).EntireRow.Insert

HTH,
Bernie
MS Excel MVP


"Frantic Excel-er" wrote in
message ...
I was wondering if it is possible to insert a line without a direct cell
reference.
This is exactly what I am trying to do...

I have import files that have many different lines...(each one is unique).
I wrote a macro to go thru the many tedious steps, except I am stuck on

the
line insertion part....I do a data sort for column "C", and then I do a

find
for "X" (which is a separation point). What I want to happen is for the
macro to find "X" and insert a line above it, regardless of which row "X"

is
on. Is there a way to do that?

Thanks!!!



  #3   Report Post  
Frantic Excel-er
 
Posts: n/a
Default

Thanks Bernie....

One more Q - I played with this and got it to work before I got your reply,
but I did nt add the "look in" string...is that important since I want to
find an X within an account number????

"Bernie Deitrick" wrote:

Frantic,

Columns("C:C").Find(What:="X", _
LookIn:=xlValues, LookAt:=xlWhole).EntireRow.Insert

HTH,
Bernie
MS Excel MVP


"Frantic Excel-er" wrote in
message ...
I was wondering if it is possible to insert a line without a direct cell
reference.
This is exactly what I am trying to do...

I have import files that have many different lines...(each one is unique).
I wrote a macro to go thru the many tedious steps, except I am stuck on

the
line insertion part....I do a data sort for column "C", and then I do a

find
for "X" (which is a separation point). What I want to happen is for the
macro to find "X" and insert a line above it, regardless of which row "X"

is
on. Is there a way to do that?

Thanks!!!




  #4   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Frantic,

The lookin isn't really that important unless you want to ignore values (the
results of formulas) and look at formulas themselves. Just don't use the
LookAt:=xlWhole - change that to xlPart instead.

HTH,
Bernie
MS Excel MVP


"Frantic Excel-er" wrote in
message ...
Thanks Bernie....

One more Q - I played with this and got it to work before I got your

reply,
but I did nt add the "look in" string...is that important since I want to
find an X within an account number????

"Bernie Deitrick" wrote:

Frantic,

Columns("C:C").Find(What:="X", _
LookIn:=xlValues, LookAt:=xlWhole).EntireRow.Insert

HTH,
Bernie
MS Excel MVP


"Frantic Excel-er" wrote in
message ...
I was wondering if it is possible to insert a line without a direct

cell
reference.
This is exactly what I am trying to do...

I have import files that have many different lines...(each one is

unique).
I wrote a macro to go thru the many tedious steps, except I am stuck

on
the
line insertion part....I do a data sort for column "C", and then I do

a
find
for "X" (which is a separation point). What I want to happen is for

the
macro to find "X" and insert a line above it, regardless of which row

"X"
is
on. Is there a way to do that?

Thanks!!!






  #5   Report Post  
Posted to microsoft.public.excel.misc
Mr. T.
 
Posts: n/a
Default Macro Line Insert

I know this is an old thread, but maybe you can assisst.

I have a list of data and I would like to insert a row after a change in
data in column A.

Sample data

A B

State Code State


1 Alabama Total


Hence, I would like to create a macro insert a row when "xx state" changes!


Thanks,

Larry T
"Bernie Deitrick" wrote:

Frantic,

Columns("C:C").Find(What:="X", _
LookIn:=xlValues, LookAt:=xlWhole).EntireRow.Insert

HTH,
Bernie
MS Excel MVP


"Frantic Excel-er" wrote in
message ...
I was wondering if it is possible to insert a line without a direct cell
reference.
This is exactly what I am trying to do...

I have import files that have many different lines...(each one is unique).
I wrote a macro to go thru the many tedious steps, except I am stuck on

the
line insertion part....I do a data sort for column "C", and then I do a

find
for "X" (which is a separation point). What I want to happen is for the
macro to find "X" and insert a line above it, regardless of which row "X"

is
on. Is there a way to do that?

Thanks!!!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert date in macro George Gee New Users to Excel 12 April 17th 06 05:44 AM
Insert Line Macro Spyder Excel Discussion (Misc queries) 1 March 3rd 05 12:17 AM
How do I insert the date using a macro tara0801 Excel Discussion (Misc queries) 4 February 10th 05 09:09 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM
Macro - Skipping a line PaulPoll Excel Worksheet Functions 4 December 21st 04 12:43 AM


All times are GMT +1. The time now is 04:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"