#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Still stuck

I am trying to add a new part to a list i have in Excel.
I'm currently using:
Sub NEWDETAIL()
Sheets("DETAILS").Select
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
End Sub

This takes the user to the next empty cell in column A but
i would like to go a step further. Is it possible to
continue the pattern in column A into this blank cell and
then leave the user at the bottom of column B?

I guess part of it might be something like:

Selection.AutoFill Destination:=Range("A632:A633"),
Type:=xlFillDefault

but i need it not to be relative to specific cells.
Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Still stuck

Hi
I think you received some solutions in your original thread. What does
not work for you with them?

--
Regards
Frank Kabel
Frankfurt, Germany

"Adrian" schrieb im Newsbeitrag
...
I am trying to add a new part to a list i have in Excel.
I'm currently using:
Sub NEWDETAIL()
Sheets("DETAILS").Select
Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
End Sub

This takes the user to the next empty cell in column A but
i would like to go a step further. Is it possible to
continue the pattern in column A into this blank cell and
then leave the user at the bottom of column B?

I guess part of it might be something like:

Selection.AutoFill Destination:=Range("A632:A633"),
Type:=xlFillDefault

but i need it not to be relative to specific cells.
Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Still stuck

i tried your solution but it says 'Run time error '13'.
type mismatch'

then highlights:
.Cells(lastrow, "A").Value = .Cells(lastrow -
1, "A").Value + 1

i have tried it with and without 'sub foo()' and 'End if'
but i'm not really good enough to know what i'm doing

Bobs solution ran but didnt actually continue the pattern
into the next black cell in column A, tho it did copy what
was in the last cell in column A. It just didnt do
anything with it tho.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Still stuck

Hi
what kind of values do you have in column A. My solution expects a
number, Bob's solution just copies the last value. So you may give some
example data for column A and your expected result after running the
macro.

In addition I would assume that also a IF formula in column A could
work

--
Regards
Frank Kabel
Frankfurt, Germany

"Adrian" schrieb im Newsbeitrag
...
i tried your solution but it says 'Run time error '13'.
type mismatch'

then highlights:
.Cells(lastrow, "A").Value = .Cells(lastrow -
1, "A").Value + 1

i have tried it with and without 'sub foo()' and 'End if'
but i'm not really good enough to know what i'm doing

Bobs solution ran but didnt actually continue the pattern
into the next black cell in column A, tho it did copy what
was in the last cell in column A. It just didnt do
anything with it tho.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Still stuck

Column A contains part numbers, ie. A0123, A0124...

Excel does recognise it as a pattern so it is possible to
click on the previous cell and copy down using the bottom
right of the cell (you know what i mean).

I want the user to be able to click the 'Add new Detail'
button and have the macro enter the next part number and
put the active cell in column B so the user can enter the
description. phew, that was a long sentance.

What i have now works fine. This is more like fine tuning
the system but it would be nice to have.

Thanks for all your help.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Still stuck

Hi
do your part numbers alsways have the layout A0000
if yes change the line
..Cells(lastrow, "A").Value = .Cells(lastrow - 1, "A").Value + 1

to the following line (all in one line)
..Cells(lastrow, "A").Value = "A" & Format(--right(.Cells(lastrow - 1,
"A").Value,4) + 1,"0000")

--
Regards
Frank Kabel
Frankfurt, Germany

"Adrian" schrieb im Newsbeitrag
...
Column A contains part numbers, ie. A0123, A0124...

Excel does recognise it as a pattern so it is possible to
click on the previous cell and copy down using the bottom
right of the cell (you know what i mean).

I want the user to be able to click the 'Add new Detail'
button and have the macro enter the next part number and
put the active cell in column B so the user can enter the
description. phew, that was a long sentance.

What i have now works fine. This is more like fine tuning
the system but it would be nice to have.

Thanks for all your help.


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
Sorry but i am stuck again KODIAK BEAR New Users to Excel 5 October 1st 07 08:46 PM
Im stuck again... Meader Excel Discussion (Misc queries) 2 May 29th 07 01:23 AM
Stuck... Mike Excel Discussion (Misc queries) 4 May 22nd 06 08:09 PM
stuck darkbearpooh1 Excel Worksheet Functions 7 February 10th 06 10:21 PM
Stuck with an =IF Mark R... Excel Worksheet Functions 2 January 25th 06 04:41 PM


All times are GMT +1. The time now is 05:24 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"