Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Completing Formula in Vba

I have this formula that was given to me here 1 year ago (wich i only have to
thanks), and it works just fine, but now i have a new aplicattion for it and
need just an adjustement but i don't to do it. I've tryed to change the
simple things in formula, but didn't worked, so i ask the experts! Which i
Thank in advanced.

I have a sheet that has this data. f.e.:
A b C D E
1 Y Date 434
2 K Date 456
3 J Date 56
4 K Date 89

What i want is to extract the "letter" K, to sheet K, ad other letters to
sheets with their letter. I can do this with the formula i present next:
Sub Ferias()
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub

The problem is that i want the sheet K(f.e.) starts in "A7"(f.e) instead of
A1, to make the many sheet's that i will have ready to print, with the
formatt that i want. And some little details, that i have in sheet. I know i
could copy the sheet where i have the data to sheet K, but who will work with
the sheet's can confuse.
Can someone help me?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Completing Formula in Vba

Hi

Try adding 6 to the destination cell number, to change the starting
position from A1 to A7.
This can be achieved by setting irow to 6 before entering the loop, then
the first time K is found, irow=irow +1 will set irow to 7 and the cell
to which the data is being written will become A7.

Sub Ferias()
Dim i as long, irow as long
irow = 6
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub


--
Regards

Roger Govier


"Micos3" wrote in message
...
I have this formula that was given to me here 1 year ago (wich i only
have to
thanks), and it works just fine, but now i have a new aplicattion for
it and
need just an adjustement but i don't to do it. I've tryed to change
the
simple things in formula, but didn't worked, so i ask the experts!
Which i
Thank in advanced.

I have a sheet that has this data. f.e.:
A b C D E
1 Y Date 434
2 K Date 456
3 J Date 56
4 K Date 89

What i want is to extract the "letter" K, to sheet K, ad other letters
to
sheets with their letter. I can do this with the formula i present
next:
Sub Ferias()
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy
Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub

The problem is that i want the sheet K(f.e.) starts in "A7"(f.e)
instead of
A1, to make the many sheet's that i will have ready to print, with the
formatt that i want. And some little details, that i have in sheet. I
know i
could copy the sheet where i have the data to sheet K, but who will
work with
the sheet's can confuse.
Can someone help me?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Completing Formula in Vba

Hi

Many Thanks, now i can do exactly what i want.
Once again,
Thank You

My best regards

"Roger Govier" escreveu:

Hi

Try adding 6 to the destination cell number, to change the starting
position from A1 to A7.
This can be achieved by setting irow to 6 before entering the loop, then
the first time K is found, irow=irow +1 will set irow to 7 and the cell
to which the data is being written will become A7.

Sub Ferias()
Dim i as long, irow as long
irow = 6
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub


--
Regards

Roger Govier


"Micos3" wrote in message
...
I have this formula that was given to me here 1 year ago (wich i only
have to
thanks), and it works just fine, but now i have a new aplicattion for
it and
need just an adjustement but i don't to do it. I've tryed to change
the
simple things in formula, but didn't worked, so i ask the experts!
Which i
Thank in advanced.

I have a sheet that has this data. f.e.:
A b C D E
1 Y Date 434
2 K Date 456
3 J Date 56
4 K Date 89

What i want is to extract the "letter" K, to sheet K, ad other letters
to
sheets with their letter. I can do this with the formula i present
next:
Sub Ferias()
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy
Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub

The problem is that i want the sheet K(f.e.) starts in "A7"(f.e)
instead of
A1, to make the many sheet's that i will have ready to print, with the
formatt that i want. And some little details, that i have in sheet. I
know i
could copy the sheet where i have the data to sheet K, but who will
work with
the sheet's can confuse.
Can someone help me?

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Completing Formula in Vba

Hi

You are very welcome, and thanks for the feedback to let us know it
worked for you.

--
Regards

Roger Govier


"Micos3" wrote in message
...
Hi

Many Thanks, now i can do exactly what i want.
Once again,
Thank You

My best regards

"Roger Govier" escreveu:

Hi

Try adding 6 to the destination cell number, to change the starting
position from A1 to A7.
This can be achieved by setting irow to 6 before entering the loop,
then
the first time K is found, irow=irow +1 will set irow to 7 and the
cell
to which the data is being written will become A7.

Sub Ferias()
Dim i as long, irow as long
irow = 6
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub


--
Regards

Roger Govier


"Micos3" wrote in message
...
I have this formula that was given to me here 1 year ago (wich i
only
have to
thanks), and it works just fine, but now i have a new aplicattion
for
it and
need just an adjustement but i don't to do it. I've tryed to change
the
simple things in formula, but didn't worked, so i ask the experts!
Which i
Thank in advanced.

I have a sheet that has this data. f.e.:
A b C D E
1 Y Date 434
2 K Date 456
3 J Date 56
4 K Date 89

What i want is to extract the "letter" K, to sheet K, ad other
letters
to
sheets with their letter. I can do this with the formula i present
next:
Sub Ferias()
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "B").Value = "K" Then
iRow = iRow + 1
Cells(i, "C").Resize(, 10).Copy
Worksheets("Folha2").Range("A" &
iRow)
End If
Next i
End Sub

The problem is that i want the sheet K(f.e.) starts in "A7"(f.e)
instead of
A1, to make the many sheet's that i will have ready to print, with
the
formatt that i want. And some little details, that i have in sheet.
I
know i
could copy the sheet where i have the data to sheet K, but who will
work with
the sheet's can confuse.
Can someone help me?

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
Does anyone have a template for completing tax forms 1098, 1099? J. Schubert Excel Discussion (Misc queries) 2 January 24th 13 04:32 PM
Macro for Not Allowing to Save without first completing fields HROBERTSON Excel Discussion (Misc queries) 1 January 5th 07 03:12 PM
Auto Completing Fields but not changing later... jturmel Excel Discussion (Misc queries) 1 October 6th 05 07:42 PM
Need some help completing this Formula brigsaz Excel Worksheet Functions 1 September 23rd 05 04:34 AM
Auto Complete not completing faerie_bel Excel Discussion (Misc queries) 5 June 10th 05 01:15 PM


All times are GMT +1. The time now is 01:29 AM.

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"