PC Review


Reply
Thread Tools Rate Thread

copy cells in two columns if in bold to another sheet and insert rows

 
 
amorrison2006@googlemail.com
Guest
Posts: n/a
 
      12th Jun 2007
Hello

I'd appreciate any help someone could give with this issue,

I've not been very lucky with responses lately on this newsgroup.

I need a macro to copy cells in a column which are in bold and if they
are in bold then copy the cell next to this and the one in bold to
another sheet from Cell E26 by inserting a row in order to copy them
and shift rows down.

I am hoping someone could look at this for me as its the last part of
what I need to do and then there'd be no more questions on the same
thing,

Thanks in advance,

Andrea

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      12th Jun 2007
Andrea,

Well if this works then your lick just changed. Checks column A for boold
cell and if it finds on copies that cell and the one next to it to E26

Sub mariner()
Dim myRange As Range
Set myRange = Range("A1:a100") '<=========Alter to suit
For Each c In myRange
c.Select
x = c.Address
If Selection.Font.Bold = True Then
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.Resize(numRows + 0, numColumns + 1).Select
Selection.Copy
Worksheets("Sheet2").Cells(26, 5).Insert shift:=xlDown
End If
Next
End Sub

Will that do?

Mike

"(E-Mail Removed)" wrote:

> Hello
>
> I'd appreciate any help someone could give with this issue,
>
> I've not been very lucky with responses lately on this newsgroup.
>
> I need a macro to copy cells in a column which are in bold and if they
> are in bold then copy the cell next to this and the one in bold to
> another sheet from Cell E26 by inserting a row in order to copy them
> and shift rows down.
>
> I am hoping someone could look at this for me as its the last part of
> what I need to do and then there'd be no more questions on the same
> thing,
>
> Thanks in advance,
>
> Andrea
>
>

 
Reply With Quote
 
amorrison2006@googlemail.com
Guest
Posts: n/a
 
      12th Jun 2007
Hello Mike

Thanks for your response,

I greatly appreciate this,

I've been ignored for days on this newsgroup.....

The words to a certain degree. I want to shift the rows down in the
sheet it copies to as I have data below which is required to be
completed by the user. Shifting cells down puts everything out of
place,

Hope you can help with this adjustment,

Thanks so much

Andrea

On 12 Jun, 15:39, Mike H <M...@discussions.microsoft.com> wrote:
> Andrea,
>
> Well if this works then your lick just changed. Checks column A for boold
> cell and if it finds on copies that cell and the one next to it to E26
>
> Sub mariner()
> Dim myRange As Range
> Set myRange = Range("A1:a100") '<=========Alter to suit
> For Each c In myRange
> c.Select
> x = c.Address
> If Selection.Font.Bold = True Then
> numRows = Selection.Rows.Count
> numColumns = Selection.Columns.Count
> Selection.Resize(numRows + 0, numColumns + 1).Select
> Selection.Copy
> Worksheets("Sheet2").Cells(26, 5).Insert shift:=xlDown
> End If
> Next
> End Sub
>
> Will that do?
>
> Mike
>
>
>
> "amorrison2...@googlemail.com" wrote:
> > Hello

>
> > I'd appreciate any help someone could give with this issue,

>
> > I've not been very lucky with responses lately on this newsgroup.

>
> > I need a macro to copy cells in a column which are in bold and if they
> > are in bold then copy the cell next to this and the one in bold to
> > another sheet from Cell E26 by inserting a row in order to copy them
> > and shift rows down.

>
> > I am hoping someone could look at this for me as its the last part of
> > what I need to do and then there'd be no more questions on the same
> > thing,

>
> > Thanks in advance,

>
> > Andrea- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      12th Jun 2007
And if Mike's don't work the way you want, you can try this one:

Sub cpybls()
For Each cell In Worksheets(1).Range("$A$1:$E$15")
If cell.Font.Bold = True Then
If Not cell Is Nothing Then
fRng = cell.Address
End If
pRng = Range(fRng).Offset(0, 1).Address
Worksheets(2).Range("$E$26").EntireRow.Insert
Range(fRng & ":" & pRng).Copy
Worksheets(2).Range("$E$26").PasteSpecial Paste:=xlValues
End If
Application.CutCopyMode = False
Next
End Sub

Since Mike and I had to do a lot of guessing about the sheets your data is
on, and what range the data is in (out of over 16 million possibilities), we
could have guessed wrong. In that case, just post again and give a little
bit more information like: My data is located in range A1:H250 on Sheet 2
and I want to find all the cells with bold font and move each cell with the
bold font along with the cell to its (left/right/above/below - pick one) to
sheet 3 starting at cell X20 and continuing in column X downward by inserting
new rows.

I know that it is not easy to ask for help when you don't understand how
something works. That is why I tried to show you how to help us help you.



"(E-Mail Removed)" wrote:

> Hello
>
> I'd appreciate any help someone could give with this issue,
>
> I've not been very lucky with responses lately on this newsgroup.
>
> I need a macro to copy cells in a column which are in bold and if they
> are in bold then copy the cell next to this and the one in bold to
> another sheet from Cell E26 by inserting a row in order to copy them
> and shift rows down.
>
> I am hoping someone could look at this for me as its the last part of
> what I need to do and then there'd be no more questions on the same
> thing,
>
> Thanks in advance,
>
> Andrea
>
>

 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      12th Jun 2007
I still may not understand but here we go version 2.

1. Loop now executes backwards to keep data in same order.
2. An entire row is inserted at row 26 shifting everything down.

Sub versive()
Dim myRange As Range
For x = 100 To 1 Step -1
Cells(x, 1).Select ' The 1 represents column A alter to suit
If Selection.Font.Bold = True Then
Selection.Resize(1 + 0, 1 + 1).Select
Worksheets("Sheet2").Range("$E$26").EntireRow.Insert
Selection.Copy
Sheets("Sheet2").Range("G26").PasteSpecial Paste:=xlPasteValues
End If
Next
End Sub

Mike

"(E-Mail Removed)" wrote:

> Hello Mike
>
> Thanks for your response,
>
> I greatly appreciate this,
>
> I've been ignored for days on this newsgroup.....
>
> The words to a certain degree. I want to shift the rows down in the
> sheet it copies to as I have data below which is required to be
> completed by the user. Shifting cells down puts everything out of
> place,
>
> Hope you can help with this adjustment,
>
> Thanks so much
>
> Andrea
>
> On 12 Jun, 15:39, Mike H <M...@discussions.microsoft.com> wrote:
> > Andrea,
> >
> > Well if this works then your lick just changed. Checks column A for boold
> > cell and if it finds on copies that cell and the one next to it to E26
> >
> > Sub mariner()
> > Dim myRange As Range
> > Set myRange = Range("A1:a100") '<=========Alter to suit
> > For Each c In myRange
> > c.Select
> > x = c.Address
> > If Selection.Font.Bold = True Then
> > numRows = Selection.Rows.Count
> > numColumns = Selection.Columns.Count
> > Selection.Resize(numRows + 0, numColumns + 1).Select
> > Selection.Copy
> > Worksheets("Sheet2").Cells(26, 5).Insert shift:=xlDown
> > End If
> > Next
> > End Sub
> >
> > Will that do?
> >
> > Mike
> >
> >
> >
> > "amorrison2...@googlemail.com" wrote:
> > > Hello

> >
> > > I'd appreciate any help someone could give with this issue,

> >
> > > I've not been very lucky with responses lately on this newsgroup.

> >
> > > I need a macro to copy cells in a column which are in bold and if they
> > > are in bold then copy the cell next to this and the one in bold to
> > > another sheet from Cell E26 by inserting a row in order to copy them
> > > and shift rows down.

> >
> > > I am hoping someone could look at this for me as its the last part of
> > > what I need to do and then there'd be no more questions on the same
> > > thing,

> >
> > > Thanks in advance,

> >
> > > Andrea- Hide quoted text -

> >
> > - Show quoted text -

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CANT INSERT CELLS, ONLY ROWS & COLUMNS robin l Microsoft Excel Worksheet Functions 1 16th Apr 2009 05:43 PM
2007 excel work sheet will not allow to insert rows or columns David Microsoft Excel Misc 1 24th Jan 2009 07:30 PM
How do i copy rows to columns on separate sheet, and have them upd =?Utf-8?B?R3Jl?= Microsoft Excel Worksheet Functions 2 23rd Nov 2006 05:36 PM
Insert Cells, Rows & Columns Dimmed Out =?Utf-8?B?VC1SZXg=?= Microsoft Excel Worksheet Functions 0 17th Oct 2004 03:27 PM
Copy Cells from columns to rows =?Utf-8?B?U2tpcGM=?= Microsoft Excel Programming 4 16th Nov 2003 03:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:19 AM.