Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dpt dpt is offline
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


hi all,

I need to copy the value of a cell in b9 and value of a cell in b19
from worksheet summary to a new work sheet historical data.

These cells are subject to change frequently, so i need to keep the
history data in teh new sheet.

In the new sheet it should look something like this:

Date Estimated effort

10-feb 23
11-feb 12 and so on.

please help me by giving the excel code to achieve this.Its really
urgent

Thanks in advance..


--
dpt
------------------------------------------------------------------------
dpt's Profile: http://www.excelforum.com/member.php...o&userid=25861
View this thread: http://www.excelforum.com/showthread...hreadid=392446

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default macro to save a values of a cell in a new sheet as a new row

hi,
i'm assuming that the new sheet will have the data in columns A and B. if
not you will have to edit the macro.
you will have to change the sheet names in the macro.

Sub macCaptureData()
Dim ccc As Range
Dim ccc2 As Range
Dim ppp As Range
Dim ppp2 As Range
Sheets("Yoursheet").Select
Set ccc = Range("B9")
Set ppp = Range("B19")
Set ccc2 = Sheets("newsheet").Range("A1").End(xlDown).Offset( 1, 0)
Set ppp2 = Sheets("newsheet").Range("B1").End(xlDown).Offset( 1, 0)
ccc2.Value = ccc.Value
ppp2.Value = ppp.Value
End Sub

regards
FSt1

"dpt" wrote:


hi all,

I need to copy the value of a cell in b9 and value of a cell in b19
from worksheet summary to a new work sheet historical data.

These cells are subject to change frequently, so i need to keep the
history data in teh new sheet.

In the new sheet it should look something like this:

Date Estimated effort

10-feb 23
11-feb 12 and so on.

please help me by giving the excel code to achieve this.Its really
urgent

Thanks in advance..


--
dpt
------------------------------------------------------------------------
dpt's Profile: http://www.excelforum.com/member.php...o&userid=25861
View this thread: http://www.excelforum.com/showthread...hreadid=392446


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


<Dpt thanks a lot for the kind help, its simple and it worked.



FSt1 Wrote:
hi,
i'm assuming that the new sheet will have the data in columns A and B
if
not you will have to edit the macro.
you will have to change the sheet names in the macro.

Sub macCaptureData()
Dim ccc As Range
Dim ccc2 As Range
Dim ppp As Range
Dim ppp2 As Range
Sheets("Yoursheet").Select
Set ccc = Range("B9")
Set ppp = Range("B19")
Set ccc2 = Sheets("newsheet").Range("A1").End(xlDown).Offset( 1, 0)
Set ppp2 = Sheets("newsheet").Range("B1").End(xlDown).Offset( 1, 0)
ccc2.Value = ccc.Value
ppp2.Value = ppp.Value
End Sub

regards
FSt1

"dpt" wrote:


hi all,

I need to copy the value of a cell in b9 and value of a cell in b19
from worksheet summary to a new work sheet historical data.

These cells are subject to change frequently, so i need to keep the
history data in teh new sheet.

In the new sheet it should look something like this:

Date Estimated effort

10-feb 23
11-feb 12 and so on.

please help me by giving the excel code to achieve this.Its really
urgent

Thanks in advance..


--
dpt


------------------------------------------------------------------------
dpt's Profile

http://www.excelforum.com/member.php...o&userid=25861
View this thread

http://www.excelforum.com/showthread...hreadid=392446



--
dp
-----------------------------------------------------------------------
dpt's Profile: http://www.excelforum.com/member.php...fo&userid=2586
View this thread: http://www.excelforum.com/showthread.php?threadid=39244

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


Hi,

I just modified the code which u sent to some thing like this and it
working as desired but there is disadvantage with it .

Sub macInsertData()
Dim estdate As Range
Dim dt As Range
Dim esteffort As Range
Dim effort As Range
Sheets("Summary").Select
Set dt = Range("B9")
Set effort = Range("B19")

Dim lastrow As Long
Worksheets("Historical Data").Activate
ActiveCell.SpecialCells(xlCellTypeLastCell).Select
lastrow = ActiveCell.Row
Cells(lastrow + 1, 1).Value = dt.Value
Cells(lastrow + 1, 2).Value = effort.Value
End Sub

This above code is working fine when are values row by row, but thi
fails when there are some values after several blank rows, i mean

row1------date1 effort1
row2------date2 effort2
row3------blank
row4------blank
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


Try something like:

Sub macInsertData()
Dim estdate As Range
Dim dt As Range
Dim esteffort As Range
Dim effort As Range
Sheets("Summary").Select
Set dt = Range("B9")
Set effort = Range("B19")

Dim lastrow As Long
Worksheets("Historical Data").Activate
'ActiveCell.SpecialCells(xlCellTypeLastCell).Selec t
'lastrow = ActiveCell.Row
lastrow = dt.End(xlDown).Row + 1
Cells(lastrow + 1, 1).Value = dt.Value
Cells(lastrow + 1, 2).Value = effort.Value
End Sub




Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=39244



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


mangesh_yadav Wrote:
Try something like:

Sub macInsertData()
Dim estdate As Range
Dim dt As Range
Dim esteffort As Range
Dim effort As Range
Sheets("Summary").Select
Set dt = Range("B9")
Set effort = Range("B19")

Dim lastrow As Long
Worksheets("Historical Data").Activate
'ActiveCell.SpecialCells(xlCellTypeLastCell).Selec t
'lastrow = ActiveCell.Row
lastrow = dt.End(xlDown).Row + 1
Cells(lastrow + 1, 1).Value = dt.Value
Cells(lastrow + 1, 2).Value = effort.Value
End Sub




Mangesh


Hi Mangesh,

Its not working quite right.If the 3 rows are filled and from 3rd row
to 12 rows is blank, it every time starts inserting rows from the 13th
row, dnt know , even i delete the previous rows it always starts from
the 13 th row.

Can you please determine the reason for it.i tried several other things
but no desired results.

I hope u get back with an answer, if u dnt mind u can try this code.

Thanks.


--
dpt
------------------------------------------------------------------------
dpt's Profile: http://www.excelforum.com/member.php...o&userid=25861
View this thread: http://www.excelforum.com/showthread...hreadid=392446

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


I am assuming your first row is cell B9. The next is B10 and third i
B11. If this is the case, the cod eI provided should work as what i
does is basically start from cell B9. Then it replicates the key pres
"control + down_arrow_key" this takes it to cell B11. Add 1 to go t
the next row i.e. B12.
This is what my code is doing. Isn't this what it is supposed t
do...?

Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=39244

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to save a values of a cell in a new sheet as a new row


No No No....the values of B9 and B19 from worksheet summary should b
copied to worksheet Historical Data as new row, each time a key i
pressed in the summary sheet.

In the Historical Sheet the first row available for inserting data i
row 4.

So it should be something like

row4.......date effort
row5.......date effort

and so on.

--
dp
-----------------------------------------------------------------------
dpt's Profile: http://www.excelforum.com/member.php...fo&userid=2586
View this thread: http://www.excelforum.com/showthread.php?threadid=39244

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
a Macro to "save as" filename from a cell on the sheet and then pr gugertmk Excel Discussion (Misc queries) 0 March 31st 09 12:32 AM
How can I save my sheet in macro FSt1 Excel Discussion (Misc queries) 2 February 10th 07 08:54 AM
Save only values of one sheet Anja Excel Discussion (Misc queries) 1 March 10th 05 09:51 AM
Macro to save as using two cell values inside worksheet sdblack Excel Programming 1 September 24th 04 03:21 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"