VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple Odds and Ends for insertion into Excel.Create a fill, make numbers move in one cell of Excel

by Steve James (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 25th July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simple Odds and Ends for insertion into Excel.Create a fill, make numbers move in one cell of Excel, etc..

API Declarations



Public Excel As Excel.Application ' This line is very important
Dim Worksheet1 As Worksheet
Dim workbook As New workbook
Dim Try(1, 2)

Rate Simple Odds and Ends for insertion into Excel.Create a fill, make numbers move in one cell of Excel



  
Private Sub Command1_Click()

Set Excel = New Excel.Application
Set workbook = Excel.Workbooks.Add
Excel.Visible = True
Set Worksheet1 = workbook.ActiveSheet

str1 = " The coW ran OVer the Moon"
str2 = StrConv(str1, vbLowerCase)

str3 = " A boy is a boy is a boy"


str4 = Replace(str3, "a", "the", , , vbTextCompare)
str5 = Format(str1, "&")   ' I don't know how to use this properly
str6 = Format(str1, ">")   ' Force uppercase on string1

Worksheet1.Cells(2, 3) = str2
Worksheet1.Cells(4, 3) = str4
Worksheet1.Cells(5, 3) = str5
Worksheet1.Cells(6, 3) = str6

'Worksheet1.Cells(7, 3) = Nstr2
'Worksheet1.Cells(8, 3) = Nstr3

For x = 1 To 5 Step (0.5)

Worksheet1.Cells(x, 1) = x

Next x

For tt = 1 To 10 Step (0.01)   ' This counts in one cell
Worksheet1.Cells(1, 6) = tt
Next tt

Try(0, 1) = " This is (0,1)"  ' insert an array value
Try(1, 2) = " This is (1,2)"

Worksheet1.Cells(10, 5) = Try(0, 1)
Worksheet1.Cells(11, 5) = Try(1, 2)

End Sub


Download this snippet    Add to My Saved Code

Simple Odds and Ends for insertion into Excel.Create a fill, make numbers move in one cell of Excel Comments

No comments have been posted about Simple Odds and Ends for insertion into Excel.Create a fill, make numbers move in one cell of Excel. Why not be the first to post a comment about Simple Odds and Ends for insertion into Excel.Create a fill, make numbers move in one cell of Excel.

Post your comment

Subject:
Message:
0/1000 characters