Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Copy outside Clipboard contents (html page) to a cell in Excel

Hi,

I have a webpage from which i am selecting & copying vertical data. Now
I open Excel & select Cell A5 & then right-click & select PasteSpecial,
then in PasteSpecial window, select Values & Transpose, to transpose
data horizontally.

I want to automate the whole process so that once i select & copy
webpage data, it should already be available in windows Clipboard, so
that once i open Excel, i just need to click on a button & it will
collect data & paste it horizontally from cell A5.

Also, once row cells are filled, the next time i enter another webpage
data, it should paste it horizontally to cell A6 below.

Please help!

Sifar

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Copy outside Clipboard contents (html page) to a cell in Excel

Dim i As Long

i = ActiveSheet.UsedRange.Rows.Count + 1
Range("A" & i).PasteSpecial Paste:=xlPasteValues, Transpose:=True

The value for 'i' above will only work if there are no other entries in
other columns in rows below the target. If so, search 'last cell' in
this group to find plenty of examples on how to get the last non-empty
row in a column.

HTH,

Nick Hebb
http://www.breezetree.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Copy outside Clipboard contents (html page) to a cell in Excel

Hi,

Thanks for Replying. I am trying this code to get clipboard contents.

=============================================
Public Function GetOffClipboard() As Variant

Rem Here, if Clipboard is empty, i get an Error message. I want to let
user know that he/she has not copied anything to clipboard & then either
exit from or ask for input. How do i check if Clipboard is Empty?

Dim MyDataObj As New DataObject
MyDataObj.GetFromClipboard
GetOffClipboard = MyDataObj.GetText()
End Function

Sub Pastetxt()
With Worksheets(1)
GetOffClipboard
Dim i As Long

Rem I need a Check here. so that it can detect Row empty & paste the
clipboard content into each Column cell on Current ROW. Sort of a LOOP
which will check if the current row is Empty or not. If its Empty, will
paste Clipboard contents to current ROW(always starting from 1st
Column), Else will move Row+1 i.e. next Row & then Paste to Below Row.

i = ActiveSheet.UsedRange.Rows.Count + 1
.Range("A" & i).PasteSpecial Paste:=xlPasteValues, Transpose:=True
End With
End Sub

Warm Regards,

Eijaz


*** Sent via Developersdex http://www.developersdex.com ***
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
Create HTML code for a hyperlink from cell contents Billy_McSkintos Excel Worksheet Functions 1 January 26th 11 04:20 AM
How could I display an excel cell contents in a page header ? Leo Excel Worksheet Functions 1 February 15th 10 01:45 PM
Copy contents to another page Richard Excel Worksheet Functions 2 March 24th 08 01:08 AM
copy cell contents to different page adamt1973 Excel Discussion (Misc queries) 1 February 5th 07 04:32 PM
how do I keep clipboard contents active in excel? Gunchla Excel Discussion (Misc queries) 1 January 30th 06 02:49 PM


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