Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default paste transpose array of variables

I have a macro to copy from first column and then paste transpose into the
second row .

How do I just copy and paste only from a specific character €œ:€ in each cell?
Eg if in a cell the value is €œ abcd:ID€ , I would like to copy and paste
transpose only €œID€.
I have the following code to just copy and paste everything in the cells. I
am not sure how to paste from only specific character.

Thank you very much in advance for you help.
I am using the following code:

Public Sub test()
Dim ws As Worksheet
Dim Lastrow As Long
For Each ws In ActiveWorkbook.Worksheets
With ws
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
..Range(.Cells(1, 1), .Cells(Lastrow, 1)).Copy
..Range(.Cells(2, 2), .Cells(2, Lastrow + 1)).PasteSpecial Paste:=xlPasteAll,
Transpose:=True
End With
Next ws
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default paste transpose array of variables


Public Sub test()
Dim ws As Worksheet
Dim Lastrow As Long
For Each ws In ActiveWorkbook.Worksheets
With ws
ColCount = 2
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 1 to LastRow
if instr(.Range("A" & RowCount),"€œ:€") 0 then
..Range("A" & RowCount).copy _
destination:=.cells(2,ColCount)
ColCount = ColCount + 1
End if
Next RowCount
End With
Next ws
End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=145154

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default paste transpose array of variables

Try this:

==========
Sub test()
Dim ws As Worksheet
Dim Lastrow As Long, i As Long
For Each ws In ActiveWorkbook.Worksheets
With ws
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To Lastrow
.Cells(2, i + 1) = Mid(.Cells(i, 1), InStr(.Cells(i, 1), ":") + 1)
Next i
End With
Next ws
End Sub
=========

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Sheela" wrote:

I have a macro to copy from first column and then paste transpose into the
second row .

How do I just copy and paste only from a specific character €œ:€ in each cell?
Eg if in a cell the value is €œ abcd:ID€ , I would like to copy and paste
transpose only €œID€.
I have the following code to just copy and paste everything in the cells. I
am not sure how to paste from only specific character.

Thank you very much in advance for you help.
I am using the following code:

Public Sub test()
Dim ws As Worksheet
Dim Lastrow As Long
For Each ws In ActiveWorkbook.Worksheets
With ws
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
.Range(.Cells(1, 1), .Cells(Lastrow, 1)).Copy
.Range(.Cells(2, 2), .Cells(2, Lastrow + 1)).PasteSpecial Paste:=xlPasteAll,
Transpose:=True
End With
Next ws
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default paste transpose array of variables


Thank you, it worked.

"JBeaucaire" wrote:

Try this:

==========
Sub test()
Dim ws As Worksheet
Dim Lastrow As Long, i As Long
For Each ws In ActiveWorkbook.Worksheets
With ws
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
For i = 1 To Lastrow
.Cells(2, i + 1) = Mid(.Cells(i, 1), InStr(.Cells(i, 1), ":") + 1)
Next i
End With
Next ws
End Sub
=========

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Sheela" wrote:

I have a macro to copy from first column and then paste transpose into the
second row .

How do I just copy and paste only from a specific character €œ:€ in each cell?
Eg if in a cell the value is €œ abcd:ID€ , I would like to copy and paste
transpose only €œID€.
I have the following code to just copy and paste everything in the cells. I
am not sure how to paste from only specific character.

Thank you very much in advance for you help.
I am using the following code:

Public Sub test()
Dim ws As Worksheet
Dim Lastrow As Long
For Each ws In ActiveWorkbook.Worksheets
With ws
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
.Range(.Cells(1, 1), .Cells(Lastrow, 1)).Copy
.Range(.Cells(2, 2), .Cells(2, Lastrow + 1)).PasteSpecial Paste:=xlPasteAll,
Transpose:=True
End With
Next ws
End Sub

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
paste transpose Sheela Excel Programming 3 October 8th 09 03:38 PM
clearing array variables and using an array to determine min value NDBC Excel Programming 7 September 4th 09 09:43 PM
Transpose array sum SnoHo71 Excel Worksheet Functions 2 January 9th 08 10:52 PM
Using Transpose from within VBA with 256 array Renate[_2_] Excel Programming 4 March 9th 07 02:00 PM
Transpose Array drbobsled Excel Discussion (Misc queries) 1 December 1st 06 01:50 AM


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