Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default Copy paste manually



I have the format in excel file as below:

Employee Number Location Payment Type Amount ($)
123 City RI $50
City RA $25
City RX $15

124 Brisbane RA $14
Brisbane RU $12


158 Perth RT $56
Perth RA
$11

€¦€¦ and so on €“reach thousand of lines.

If I wish to have this second format €“per example below (in excel) , I do
need to copy and paste the Employee number to each row one by one.Is there
any way (any vb code /macro) that I can use for automation to get the second
report (as example below)?


Format as result of manual copy paste the Employee number as follows:

Employee Number Location Payment Type Amount ($)
123 City RI $50
123 City RA $25
23 City RX $15

124 Brisbane RA $14
124 Brisbane RU $12


158 Perth RT $56
158 Perth RA $11

€¦€¦ and so on €“reach thousand of lines.


Anyone can help and much appreciate any input /suggestion.

PA




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Copy paste manually

see chip pearson's response to "A script to fill in missing text" from
10/31

see if that's what you want. here is is post, but read the op's post, too.


Try the following code:


Dim LastRow As Long
Dim RowNdx As Long
Dim OldVal As String

LastRow = Cells(Rows.Count, "B").End(xlUp).Row
OldVal = Range("A1")
For RowNdx = 1 To LastRow
If Cells(RowNdx, "A").Value = "" Then
Cells(RowNdx, "A").Value = OldVal
Else
OldVal = Cells(RowNdx, "A").Value
End If
Next RowNdx



--


Gary


"PA" wrote in message
...


I have the format in excel file as below:

Employee Number Location Payment Type Amount ($)
123 City RI
$50
City RA
$25
City RX
$15

124 Brisbane RA $14
Brisbane RU
$12


158 Perth RT
$56
Perth RA
$11

.. and so on -reach thousand of lines.

If I wish to have this second format -per example below (in excel) , I do
need to copy and paste the Employee number to each row one by one.Is there
any way (any vb code /macro) that I can use for automation to get the
second
report (as example below)?


Format as result of manual copy paste the Employee number as follows:

Employee Number Location Payment Type Amount ($)
123 City RI
$50
123 City RA
$25
23 City RX $15

124 Brisbane RA $14
124 Brisbane RU $12


158 Perth RT
$56
158 Perth RA
$11

.. and so on -reach thousand of lines.


Anyone can help and much appreciate any input /suggestion.

PA






  #3   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default Copy paste manually

Yes, many thanks.That's Great.

PA

"PA" wrote:



I have the format in excel file as below:

Employee Number Location Payment Type Amount ($)
123 City RI $50
City RA $25
City RX $15

124 Brisbane RA $14
Brisbane RU $12


158 Perth RT $56
Perth RA
$11

€¦€¦ and so on €“reach thousand of lines.

If I wish to have this second format €“per example below (in excel) , I do
need to copy and paste the Employee number to each row one by one.Is there
any way (any vb code /macro) that I can use for automation to get the second
report (as example below)?


Format as result of manual copy paste the Employee number as follows:

Employee Number Location Payment Type Amount ($)
123 City RI $50
123 City RA $25
23 City RX $15

124 Brisbane RA $14
124 Brisbane RU $12


158 Perth RT $56
158 Perth RA $11

€¦€¦ and so on €“reach thousand of lines.


Anyone can help and much appreciate any input /suggestion.

PA




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
Activesheet.Paste does OK manually between worksheets but not in M Billyruben Excel Discussion (Misc queries) 10 November 28th 08 09:04 PM
Protected document loses all protection(hidden columns) when manually copy-pasted [email protected] Excel Discussion (Misc queries) 1 April 4th 06 10:06 PM
protected document loses all protection(hidden columns) when manually copy-pasted [email protected] Excel Worksheet Functions 3 April 4th 06 04:02 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM


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