Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default on data add formula

Hi guys (and girls)
I got a simple question...

i got a table of data thats gatherd by a macro, now i want to add 1
more line to this table.
but im not sure how to do this...

The data im looking for is "Legbord" in collum A and it has a value in
collum C.
I want to add a new line after "Legbord" (which isnt the last entry in
my table) and multiply the value for "legbord" in collum C with 2. (in
collum C for the new line)

Does this make sense?
Could you please help me?

thanks!

Sjoerd

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default on data add formula

Dim res as Variant, rng as Range
res = Application.Match("Legbord",columns(1),0)
if not iserror(res) then
set rng = cells(res,1)
rng.offset(1,0).Entirerow.Insert
cells(res + 1,1) = rng.Value
cells(res + 1,3).Value = rng.offset(0,2)*2
End if

--
Regards,
Tom Ogilvy

"Jumparound" wrote:

Hi guys (and girls)
I got a simple question...

i got a table of data thats gatherd by a macro, now i want to add 1
more line to this table.
but im not sure how to do this...

The data im looking for is "Legbord" in collum A and it has a value in
collum C.
I want to add a new line after "Legbord" (which isnt the last entry in
my table) and multiply the value for "legbord" in collum C with 2. (in
collum C for the new line)

Does this make sense?
Could you please help me?

thanks!

Sjoerd


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default on data add formula

On 1 okt, 16:45, Tom Ogilvy
wrote:
Dim res as Variant, rng as Range
res = Application.Match("Legbord",columns(1),0)
if not iserror(res) then
set rng = cells(res,1)
rng.offset(1,0).Entirerow.Insert
cells(res + 1,1) = rng.Value
cells(res + 1,3).Value = rng.offset(0,2)*2
End if

--
Regards,
Tom Ogilvy



"Jumparound" wrote:
Hi guys (and girls)
I got a simple question...


i got a table of data thats gatherd by a macro, now i want to add 1
more line to this table.
but im not sure how to do this...


The data im looking for is "Legbord" in collum A and it has a value in
collum C.
I want to add a new line after "Legbord" (which isnt the last entry in
my table) and multiply the value for "legbord" in collum C with 2. (in
collum C for the new line)


Does this make sense?
Could you please help me?


thanks!


Sjoerd- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


Thanks Tom!

one quick question,

U use res = Application.Match("Legbord",columns(1),0)
What do i change when I want to insert the name "plankdrager" instead
in "legbord" in the newly created line?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default on data add formula

On 2 okt, 09:32, Jumparound wrote:
On 1 okt, 16:45, Tom Ogilvy
wrote:





Dim res as Variant, rng as Range
res = Application.Match("Legbord",columns(1),0)
if not iserror(res) then
set rng = cells(res,1)
rng.offset(1,0).Entirerow.Insert
cells(res + 1,1) = rng.Value
cells(res + 1,3).Value = rng.offset(0,2)*2
End if


--
Regards,
Tom Ogilvy


"Jumparound" wrote:
Hi guys (and girls)
I got a simple question...


i got a table of data thats gatherd by a macro, now i want to add 1
more line to this table.
but im not sure how to do this...


The data im looking for is "Legbord" in collum A and it has a value in
collum C.
I want to add a new line after "Legbord" (which isnt the last entry in
my table) and multiply the value for "legbord" in collum C with 2. (in
collum C for the new line)


Does this make sense?
Could you please help me?


thanks!


Sjoerd- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -


Thanks Tom!

one quick question,

U use res = Application.Match("Legbord",columns(1),0)
What do i change when I want to insert the name "plankdrager" instead
in "legbord" in the newly created line?- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -


Oke, i treid some things...
this is what i got (it very ugly :( )

==========================
oRange.Offset(1, 0).EntireRow.Insert
Cells(res + 1, 1) = oRange.Value
Cells(res + 1, 3).Value = oRange.Offset(0, 2) * 2
Cells(res + 1, 1).Value = "Plankdrager"
==========================

i just copy "plankdrager" over the "legbord" cell...

Many thanks for 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
Formula to sum data from a data range mike the new guy Excel Discussion (Misc queries) 3 January 18th 06 08:56 AM
Formula to capture historical data from data that changes daily DKennedy Excel Discussion (Misc queries) 0 December 28th 05 08:24 PM
Formula to capture historical data from data that changes daily DKennedy Excel Worksheet Functions 0 December 28th 05 08:23 PM
Any cell containing formula seen as data instead of formula Jeffry61 Excel Worksheet Functions 2 September 23rd 05 02:04 PM
DATA VALIDATION - for data which is the result of a formula Gator Girl Excel Programming 5 September 12th 05 07:06 PM


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