PC Review


Reply
 
 
Faboboren
Guest
Posts: n/a
 
      26th Nov 2007
Hi,

I have arrays in 45 sheets and 11 workbooks. They have different amount of
rows (usually they do not go more than 200 rows). I want to do the autofill
from 1 to N, because after I have applied my delete macro and missing some
rows, so I need to re-sort by C column.

Thanks

 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      26th Nov 2007
Faboboren,

Lots of variables in that question that you need to first answer.

Where are the workbooks? Currently open, or in a folder? Do you have a blank column for the
autofill, or do you need to insert one, and which column do you want to use? Do you want to apply it
to all sheets, or just with some defined array? Is the array the entire sheet, or part of the
sheet? Is the array sized differently than adjacent blaocks of data?

HTH,
Bernie
MS Excel MVP


"Faboboren" <(E-Mail Removed)> wrote in message
news:616D3C9D-3763-475F-8DD5-(E-Mail Removed)...
> Hi,
>
> I have arrays in 45 sheets and 11 workbooks. They have different amount of
> rows (usually they do not go more than 200 rows). I want to do the autofill
> from 1 to N, because after I have applied my delete macro and missing some
> rows, so I need to re-sort by C column.
>
> Thanks
>



 
Reply With Quote
 
Faboboren
Guest
Posts: n/a
 
      26th Nov 2007
Hi Bernie,

Thanks for your answer.

Files are opened
I want to use column C
I have in column C after my macro deleted some rows:
1
2
3
6
7
8
10
13
14
As you can see I am missing: 4, 5,9,11,12.
In this example I need to ascending re-sort from 1 to 9 (I do not have a
blank column nor I want to insert a new column
I want to apply to all sheets in column C and workbooks(42 sheets and 11
workbooks). Arrays are variable, could go from 10 rows to 200 rows (aprox).
Columns from A to M.

"Bernie Deitrick" wrote:

> Faboboren,
>
> Lots of variables in that question that you need to first answer.
>
> Where are the workbooks? Currently open, or in a folder? Do you have a blank column for the
> autofill, or do you need to insert one, and which column do you want to use? Do you want to apply it
> to all sheets, or just with some defined array? Is the array the entire sheet, or part of the
> sheet? Is the array sized differently than adjacent blaocks of data?
>
> HTH,
> Bernie
> MS Excel MVP
>
>
> "Faboboren" <(E-Mail Removed)> wrote in message
> news:616D3C9D-3763-475F-8DD5-(E-Mail Removed)...
> > Hi,
> >
> > I have arrays in 45 sheets and 11 workbooks. They have different amount of
> > rows (usually they do not go more than 200 rows). I want to do the autofill
> > from 1 to N, because after I have applied my delete macro and missing some
> > rows, so I need to re-sort by C column.
> >
> > Thanks
> >

>
>
>

 
Reply With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      26th Nov 2007
Try the macro below.

HTH,
Bernie
MS Excel MVP

Sub ReNumColC()
Dim myB As Workbook
Dim myS As Worksheet
Dim myRow As Long

For Each myB In Application.Workbooks
If myB.Windows(1).Visible Then
For Each myS In myB.Worksheets
myRow = myS.Cells(Rows.Count, 3).End(xlUp).Row
With myS.Range("C1:C" & myRow)
.Formula = "=ROW()"
.Value = .Value
End With
Next myS
End If
Next myB
End Sub


"Faboboren" <(E-Mail Removed)> wrote in message
news:7961DE5B-BDC5-404C-A25B-(E-Mail Removed)...
> Hi Bernie,
>
> Thanks for your answer.
>
> Files are opened
> I want to use column C
> I have in column C after my macro deleted some rows:
> 1
> 2
> 3
> 6
> 7
> 8
> 10
> 13
> 14
> As you can see I am missing: 4, 5,9,11,12.
> In this example I need to ascending re-sort from 1 to 9 (I do not have a
> blank column nor I want to insert a new column
> I want to apply to all sheets in column C and workbooks(42 sheets and 11
> workbooks). Arrays are variable, could go from 10 rows to 200 rows (aprox).
> Columns from A to M.
>
> "Bernie Deitrick" wrote:
>
>> Faboboren,
>>
>> Lots of variables in that question that you need to first answer.
>>
>> Where are the workbooks? Currently open, or in a folder? Do you have a blank column for the
>> autofill, or do you need to insert one, and which column do you want to use? Do you want to apply
>> it
>> to all sheets, or just with some defined array? Is the array the entire sheet, or part of the
>> sheet? Is the array sized differently than adjacent blaocks of data?
>>
>> HTH,
>> Bernie
>> MS Excel MVP
>>
>>
>> "Faboboren" <(E-Mail Removed)> wrote in message
>> news:616D3C9D-3763-475F-8DD5-(E-Mail Removed)...
>> > Hi,
>> >
>> > I have arrays in 45 sheets and 11 workbooks. They have different amount of
>> > rows (usually they do not go more than 200 rows). I want to do the autofill
>> > from 1 to N, because after I have applied my delete macro and missing some
>> > rows, so I need to re-sort by C column.
>> >
>> > Thanks
>> >

>>
>>
>>



 
Reply With Quote
 
Faboboren
Guest
Posts: n/a
 
      26th Nov 2007
Hi Bernie,

It 's working. But because my first row to re-sort is at C7 and header at
C6, it is doing the autofill from 1 to N from C1, and I need from C7 #1.

Thanks


"Bernie Deitrick" wrote:

> Try the macro below.
>
> HTH,
> Bernie
> MS Excel MVP
>
> Sub ReNumColC()
> Dim myB As Workbook
> Dim myS As Worksheet
> Dim myRow As Long
>
> For Each myB In Application.Workbooks
> If myB.Windows(1).Visible Then
> For Each myS In myB.Worksheets
> myRow = myS.Cells(Rows.Count, 3).End(xlUp).Row
> With myS.Range("C1:C" & myRow)
> .Formula = "=ROW()"
> .Value = .Value
> End With
> Next myS
> End If
> Next myB
> End Sub
>
>
> "Faboboren" <(E-Mail Removed)> wrote in message
> news:7961DE5B-BDC5-404C-A25B-(E-Mail Removed)...
> > Hi Bernie,
> >
> > Thanks for your answer.
> >
> > Files are opened
> > I want to use column C
> > I have in column C after my macro deleted some rows:
> > 1
> > 2
> > 3
> > 6
> > 7
> > 8
> > 10
> > 13
> > 14
> > As you can see I am missing: 4, 5,9,11,12.
> > In this example I need to ascending re-sort from 1 to 9 (I do not have a
> > blank column nor I want to insert a new column
> > I want to apply to all sheets in column C and workbooks(42 sheets and 11
> > workbooks). Arrays are variable, could go from 10 rows to 200 rows (aprox).
> > Columns from A to M.
> >
> > "Bernie Deitrick" wrote:
> >
> >> Faboboren,
> >>
> >> Lots of variables in that question that you need to first answer.
> >>
> >> Where are the workbooks? Currently open, or in a folder? Do you have a blank column for the
> >> autofill, or do you need to insert one, and which column do you want to use? Do you want to apply
> >> it
> >> to all sheets, or just with some defined array? Is the array the entire sheet, or part of the
> >> sheet? Is the array sized differently than adjacent blaocks of data?
> >>
> >> HTH,
> >> Bernie
> >> MS Excel MVP
> >>
> >>
> >> "Faboboren" <(E-Mail Removed)> wrote in message
> >> news:616D3C9D-3763-475F-8DD5-(E-Mail Removed)...
> >> > Hi,
> >> >
> >> > I have arrays in 45 sheets and 11 workbooks. They have different amount of
> >> > rows (usually they do not go more than 200 rows). I want to do the autofill
> >> > from 1 to N, because after I have applied my delete macro and missing some
> >> > rows, so I need to re-sort by C column.
> >> >
> >> > Thanks
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      26th Nov 2007
Change this:

>> With myS.Range("C1:C" & myRow)
>> .Formula = "=ROW()"


to this:

With myS.Range("C7:C" & myRow)
.Formula = "=ROW()-6"



HTH,
Bernie
MS Excel MVP


"Faboboren" <(E-Mail Removed)> wrote in message
news:81213C25-AB9E-4E02-BD70-(E-Mail Removed)...
> Hi Bernie,
>
> It 's working. But because my first row to re-sort is at C7 and header at
> C6, it is doing the autofill from 1 to N from C1, and I need from C7 #1.
>
> Thanks
>
>
> "Bernie Deitrick" wrote:
>
>> Try the macro below.
>>
>> HTH,
>> Bernie
>> MS Excel MVP
>>
>> Sub ReNumColC()
>> Dim myB As Workbook
>> Dim myS As Worksheet
>> Dim myRow As Long
>>
>> For Each myB In Application.Workbooks
>> If myB.Windows(1).Visible Then
>> For Each myS In myB.Worksheets
>> myRow = myS.Cells(Rows.Count, 3).End(xlUp).Row
>> With myS.Range("C1:C" & myRow)
>> .Formula = "=ROW()"
>> .Value = .Value
>> End With
>> Next myS
>> End If
>> Next myB
>> End Sub
>>
>>
>> "Faboboren" <(E-Mail Removed)> wrote in message
>> news:7961DE5B-BDC5-404C-A25B-(E-Mail Removed)...
>> > Hi Bernie,
>> >
>> > Thanks for your answer.
>> >
>> > Files are opened
>> > I want to use column C
>> > I have in column C after my macro deleted some rows:
>> > 1
>> > 2
>> > 3
>> > 6
>> > 7
>> > 8
>> > 10
>> > 13
>> > 14
>> > As you can see I am missing: 4, 5,9,11,12.
>> > In this example I need to ascending re-sort from 1 to 9 (I do not have a
>> > blank column nor I want to insert a new column
>> > I want to apply to all sheets in column C and workbooks(42 sheets and 11
>> > workbooks). Arrays are variable, could go from 10 rows to 200 rows (aprox).
>> > Columns from A to M.
>> >
>> > "Bernie Deitrick" wrote:
>> >
>> >> Faboboren,
>> >>
>> >> Lots of variables in that question that you need to first answer.
>> >>
>> >> Where are the workbooks? Currently open, or in a folder? Do you have a blank column for the
>> >> autofill, or do you need to insert one, and which column do you want to use? Do you want to
>> >> apply
>> >> it
>> >> to all sheets, or just with some defined array? Is the array the entire sheet, or part of the
>> >> sheet? Is the array sized differently than adjacent blaocks of data?
>> >>
>> >> HTH,
>> >> Bernie
>> >> MS Excel MVP
>> >>
>> >>
>> >> "Faboboren" <(E-Mail Removed)> wrote in message
>> >> news:616D3C9D-3763-475F-8DD5-(E-Mail Removed)...
>> >> > Hi,
>> >> >
>> >> > I have arrays in 45 sheets and 11 workbooks. They have different amount of
>> >> > rows (usually they do not go more than 200 rows). I want to do the autofill
>> >> > from 1 to N, because after I have applied my delete macro and missing some
>> >> > rows, so I need to re-sort by C column.
>> >> >
>> >> > Thanks
>> >> >
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
Faboboren
Guest
Posts: n/a
 
      26th Nov 2007
Bernie,

It is working beautiful!!

Thank you very much

"Bernie Deitrick" wrote:

> Change this:
>
> >> With myS.Range("C1:C" & myRow)
> >> .Formula = "=ROW()"

>
> to this:
>
> With myS.Range("C7:C" & myRow)
> .Formula = "=ROW()-6"
>
>
>
> HTH,
> Bernie
> MS Excel MVP
>
>
> "Faboboren" <(E-Mail Removed)> wrote in message
> news:81213C25-AB9E-4E02-BD70-(E-Mail Removed)...
> > Hi Bernie,
> >
> > It 's working. But because my first row to re-sort is at C7 and header at
> > C6, it is doing the autofill from 1 to N from C1, and I need from C7 #1.
> >
> > Thanks
> >
> >
> > "Bernie Deitrick" wrote:
> >
> >> Try the macro below.
> >>
> >> HTH,
> >> Bernie
> >> MS Excel MVP
> >>
> >> Sub ReNumColC()
> >> Dim myB As Workbook
> >> Dim myS As Worksheet
> >> Dim myRow As Long
> >>
> >> For Each myB In Application.Workbooks
> >> If myB.Windows(1).Visible Then
> >> For Each myS In myB.Worksheets
> >> myRow = myS.Cells(Rows.Count, 3).End(xlUp).Row
> >> With myS.Range("C1:C" & myRow)
> >> .Formula = "=ROW()"
> >> .Value = .Value
> >> End With
> >> Next myS
> >> End If
> >> Next myB
> >> End Sub
> >>
> >>
> >> "Faboboren" <(E-Mail Removed)> wrote in message
> >> news:7961DE5B-BDC5-404C-A25B-(E-Mail Removed)...
> >> > Hi Bernie,
> >> >
> >> > Thanks for your answer.
> >> >
> >> > Files are opened
> >> > I want to use column C
> >> > I have in column C after my macro deleted some rows:
> >> > 1
> >> > 2
> >> > 3
> >> > 6
> >> > 7
> >> > 8
> >> > 10
> >> > 13
> >> > 14
> >> > As you can see I am missing: 4, 5,9,11,12.
> >> > In this example I need to ascending re-sort from 1 to 9 (I do not have a
> >> > blank column nor I want to insert a new column
> >> > I want to apply to all sheets in column C and workbooks(42 sheets and 11
> >> > workbooks). Arrays are variable, could go from 10 rows to 200 rows (aprox).
> >> > Columns from A to M.
> >> >
> >> > "Bernie Deitrick" wrote:
> >> >
> >> >> Faboboren,
> >> >>
> >> >> Lots of variables in that question that you need to first answer.
> >> >>
> >> >> Where are the workbooks? Currently open, or in a folder? Do you have a blank column for the
> >> >> autofill, or do you need to insert one, and which column do you want to use? Do you want to
> >> >> apply
> >> >> it
> >> >> to all sheets, or just with some defined array? Is the array the entire sheet, or part of the
> >> >> sheet? Is the array sized differently than adjacent blaocks of data?
> >> >>
> >> >> HTH,
> >> >> Bernie
> >> >> MS Excel MVP
> >> >>
> >> >>
> >> >> "Faboboren" <(E-Mail Removed)> wrote in message
> >> >> news:616D3C9D-3763-475F-8DD5-(E-Mail Removed)...
> >> >> > Hi,
> >> >> >
> >> >> > I have arrays in 45 sheets and 11 workbooks. They have different amount of
> >> >> > rows (usually they do not go more than 200 rows). I want to do the autofill
> >> >> > from 1 to N, because after I have applied my delete macro and missing some
> >> >> > rows, so I need to re-sort by C column.
> >> >> >
> >> >> > Thanks
> >> >> >
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      26th Nov 2007

> It is working beautiful!!
>
> Thank you very much


You're welcome!

Bernie


 
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
Autofilling a form =?Utf-8?B?TmF0ZVNjaA==?= Microsoft Access Getting Started 1 2nd Nov 2007 10:40 PM
Help with autofilling formulas moncara Microsoft Excel New Users 1 21st Jun 2006 11:42 PM
Autofilling information =?Utf-8?B?c3Vqb21v?= Microsoft Excel Worksheet Functions 0 15th Feb 2006 10:31 PM
Autofilling data Rachel Microsoft Access Forms 1 19th Nov 2003 06:59 PM
Autofilling value in Table??? Riks Microsoft Access Form Coding 1 22nd Jul 2003 04:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:14 AM.