Creating and pasting using VB

MS EXCEL

    Sponsored Links

    Next

  • 1. parse a string
    I think I almost have but am giving up. The fname lname string is concatenated together with a space and I need to parse out the Lname. Am i somewhat close? sStr = UserForm1.g_fNameLName Lname = Left(sStr, (InStr(1, sStr, " ")) - 1) thanks,
  • 2. vb for column backcolor
    TIA! I have a simple schedule that I'm using an xltl for. How do I change the backcolor of the column I am calling the function from workbook_open() Here is my function: Private Function SetWeekends() Dim wb As Workbook, sheet As Worksheet, list As Integer Dim dt As String, yr As String, range As range, c Dim i As Integer Set wb = ThisWorkbook yr = InputBox("Enter the 4 digit year this schedule " & vbCrLf & _ " is being created.", "Create Schedule") If Len(yr) <> 0 Then 'in case we cancell the inputbox With wb For i = 1 To 12 Set range = .Worksheets(i).range("c2:ag2").Cells For Each c In range If IsNull(c.Value) = False Then 'for those months with fewer than 31 days dt = DateValue(.Worksheets(i).Name & " " & c.Value & "," & yr) If DatePart("w", dt) = 1 Or DatePart("w", dt) = 7 Then .Column.BackColor = 12632256 End If End If Next c Next i End With End If Set wb = Nothing End Function
  • 3. xml & xslt formating in excel
    hello, i have an xml data report that i run. if i open it in IE provided the xslt file is in the same folder, it displays properly. my issue is i need to email these reports to other staff and i need the formating as well. i dont want to email both xml & xslt files to recipient and would also like to email it in a more office popular format. i have the xml addon tools for excel, and i am able to open xml files in excel and manipulate them, but is there a way i can open the xml file and apply the xslt formating to it then save to xls?
  • 4. Applying a function to multiple cells automaically
    Quite a basic question that I'm sure there is an easy answer to. Have a basic function (=D5*(1-E5) that shows a discounted value for an amount in D5 by the percentage in E5. How can I apply the same function to rows below without re-typing the function for each line. ie. =D6*(1-E6) etc.

Creating and pasting using VB

Postby mewilh0 » Sun, 23 Apr 2006 09:15:59 GMT

I need to create an email and paste some data already selected in excel
into the body.  I have just started to attempt this so if I need to add
mapi or anything like that please let me know.  Any help would be very
helpful....

Thanks,

Matt


Re: Creating and pasting using VB

Postby Otto Moehrbach » Mon, 24 Apr 2006 01:43:14 GMT

If you copy straight from an Excel sheet to an email, you will be pasting an 
object and that can be a nuisance, particularly if you need to edit the 
contents before sending it.  I simply paste it to Word first, then copy it 
from Word into the email.  This may not suit your needs though.  HTH   Otto







Re: Creating and pasting using VB

Postby Matt » Mon, 24 Apr 2006 12:17:42 GMT

Thanks for the quick response but I should not have to edit the object
once it is in the email.  Any ideas on how to create an email and paste
an object from excel into the body?


Re: Creating and pasting using VB

Postby Otto Moehrbach » Tue, 25 Apr 2006 07:45:15 GMT

I have done it many times with just copy/paste.  But I was copying cells 
only.  Otto







Re: Creating and pasting using VB

Postby Matt » Tue, 25 Apr 2006 10:08:28 GMT

i just have a selection of cells (i.e. a1:f28) but i can't find the
code to create an email and paste the selected data into the body....
if you could help that would be great


Re: Creating and pasting using VB

Postby Otto Moehrbach » Tue, 25 Apr 2006 23:01:52 GMT

Matt
    I must be misunderstanding you and what you want to do.  I just created 
a new email to myself,  I opened an Excel file.  I copied a group of cells. 
I went to the email message and pasted into the body of the message.  I then 
sent the message.
    I received the message and there was the group of cells.   HTH   Otto







Re: Creating and pasting using VB

Postby aidan.heritage » Tue, 25 Apr 2006 23:17:33 GMT

The missing part of this question is what email program?  Assuming
outlook, then it will be possible to do it - in essence, you would
create a new mail item, then set the body to be the range you want.


Re: Creating and pasting using VB

Postby Matt » Wed, 26 Apr 2006 02:27:15 GMT

I apologize.  Yes, I am using outlook but everytime I try to create a
new email using vb i get errors.  Do I need to include references to
another library or something?


Re: Creating and pasting using VB

Postby aidan.heritage » Thu, 27 Apr 2006 02:05:02 GMT

My email is  XXXX@XXXXX.COM  - if you email me we can perhaps
take this offline, but it can be done (the outlook model is a pain to
program, but it's do-able!)


Re: Creating and pasting using VB

Postby aidan.heritage » Fri, 28 Apr 2006 23:20:23 GMT

Just in case the email doesn't arrive, this is to alert you to the fact
that I've replied via email (!)


Similar Threads:

1.Creating and pasting using VB

I need to create an email and paste a current selection in microsoft
excel using visual basic.  I have just started to work on this so I
don't know what all I have to include.  If I need mapi add-ins or
anything else added please let me know.  I already have the sub
routines set to copy the data that I need out of excel but now I need
to email this data automattically.  Any help would be very helpful.

Thanks,

Matt

2.how to copy/paste macro to a newly created file using vba

Hello,

I have a workbook with numbers of macros - one of it translate data
numbers into text "in words". I've created a function which after
fullfilling datasheet, is copying it into a new file. And now I have a
problem, because in a new workbook there is no macro and of course there
isn't my function, so the datasheet doesn't works good.
I don't want to copy this function manually - I'd like to make it more
automatic /during copying data into a new workbook/. Unfortunatelly I
don't know how to do it.
If somebody knows how to do it, Please - show me an example.

thx,
Maleo

3.how to paste macro to a newly created file using vba

Hello,

I have a workbook with numbers of macros - one of it translate data 
numbers into text "in words". I've created a function which after 
fullfilling datasheet, is copying it into a new file. And now I have a 
problem, because in a new workbook there is no macro and of course there 
isn't my function, so the datasheet doesn't works good.
I don't want to copy this function manually - I'd like to make it more 
automatic /during copying data into a new workbook/. Unfortunatelly I 
don't know how to do it.
If somebody knows how to do it, Please - show me an example.

thx,
Maleo

4.Change source for links created using Paste Link

Hi,

I am new to VBA Word Macros.
I need code sample to change the source file for the links created
using Paste Link.

I tried using Field.LinkFormat.SourceFullName = "New file name" but
this is throwing an exception "Access is denied"

Thanks,
VSP

5.Copy Paste Chart format in Excel 2003 using VB.NET

I have a template file in Excel which contains some sample charts. I need to 
generate some charts which has the same format as that of sample charts. I'm 
using VB.NET 2005.

6. copy and paste using vb code

7. copy and paste formula using vb code

8. How do I copy and paste a powerpoint slide from excel using vb



Return to MS EXCEL

 

Who is online

Users browsing this forum: No registered users and 62 guest