Sorry, had a flat tire on Thursday eve, so I skipped work on Friday. I use OpenOffice at home so I'm still no good.
But, your problem is easy: after the Copy comment, line 68, insert
Dim ws as Worksheet
Set ws = Sheets("Export Data")
Then delete the copy, lines 69 and 70, because we will do it later
Finally, before the PasteSpecial, line 85, do the copy:
ws.Range("B4:AM 200").Copy...
User Profile
Collapse
-
Don't have time to check it until Friday, but off the top of my head replace 18 with two lines:
Cells(NumRows + 1, 1).Select
ActiveSheet.Pas teSpecial Paste:=xlPasteV alues, Operation:=xlNo ne, SkipBlanks:=Tru e, Transpose:=Fals e
Hope this works for you! BTW, when I write code involving 2 workbooks, I create an object for each book and/or sheet and fully define each range reference. Your mind keeps track, but XL doesn't...Leave a comment:
-
That's a good start in that you have outlined what needs to be done!
You need to write a main to test this class. It should at least create a new rational, then get and print the numerator and denominator.
But, do your constructor/getters/setters really do any thing? Think about where they need to get/set the data from/to.
Now, how do you add/subtract fractions? Write down the steps that you would...Leave a comment:
-
Well, I have a lot of questions, but basically what you want is
Code:Option Explicit Sub Copy2DB() ' Copy columns B thru BB, starting at row 56 Dim i As Integer i = 56 Do While Range("B" & i) <> 0 Range("B" & i & ":BB" & i).Copy Workbooks("Database.xlsx").ActiveSheet.Range("B" & i & ":BB" &
Leave a comment:
-
In order to get the picture in the background, you must insert the picture into the worksheet header, set the brightness to .85, the contrast to .15, and the ColorType to msoPictureWater mark. The picture actually goes into the PageSetup object. Easy to do in Excel, but there does not seem to be any HSSF method that support this in HSSFHeader or HSSFPageSetup. I also thought about writing an AutoOpen macro to move a worksheet picture to the header,...Leave a comment:
-
I agree that is should work, but it is always shakey to use range.Text because it returns what shows on the worksheet, but I didn't know that hidden cells have blank .Text. Use .Value instead and let VB convert it to a string. HTH --SamLeave a comment:
-
OK, here is the best that I could do. Had to switch back to HSSF because I couldn't understand the SS documentation. What a mess!
Code:import java.io.*; import org.apache.poi.hssf.usermodel.*; public class xlWatermark { public static void main(String[] args) { HSSFWorkbook wb = new HSSFWorkbook(); FileOutputStream fileOut = null; try { fileOut = new FileOutputStream("C:\\TestWM.xls");
Leave a comment:
-
Agggggg, Java and Excel do not play nicely together, but I'm having fun, LOL.
So, what API are you using for Excel?
I'm assuming org.apache.poi. ss.usermodel. Do you have
import org.apache.poi. ss.usermodel.*;
at the top?
Looking at some other posts here on Bytes, it looks like the apache poi is limited. You would be better off using a Mocrosoft environment like C# or VB. Is this an...Leave a comment:
-
Well, I've forgotten more Java than I've learned, so if you can post a snippet to create a workbook and worksheet, I can get you a watermark. What version of Excel are you using? Do you want text or a picture?
The problem is that Excel doesn't have a Watermark object: you just create a shape and change it's transparency so that it looks like a watermark. For text, after you have a WorkSheet object, then you use the AddTextEffect...Leave a comment:
-
Think about what a Marquee label does: at a regular interval the text moves.
Now, what do you need to implement this: a label control, a timer, and you need to draw the text youself, so that you can change the starting point.
The last item is a little difficult, what is involved: don't have the label draw the text, do it yourself. In programming lingo, you want to override the OnPaint event.
But this...Leave a comment:
-
A Namespace is sort of like a file folder: it helps you stay organized. So, you can have curry in the Thai folder (Namespace) and curry in the India folder (Namespace) and know that they are entirely different. Moreover, if you are only dealing with Thai cooking (in the Thai Namespace), you can just refer to curry and everyone will know that you mean Thai curry. HTH --SamLeave a comment:
-
Microsoft KB316384 http://support.microsoft.com/kb/316384 describes how to do this. You should work through this example, write your own code, and post back here with specific questions. HTHLeave a comment:
-
Googling Excel ASP.NET gives several examples of these sort of operations. Have you tried these examples?Leave a comment:
-
-
You should be able to figure that one out, LOL. I got a little fancy: the macro is a toggle. If row 3 is visible, then hide the odds. If row 3 is already hidden, then show the rows:
Code:Sub HideAndShow() ' Determine last row Dim n As Integer, i As Integer n = Cells.SpecialCells(xlCellTypeLastCell).Row ' Determine whether to hide or show Dim isHidden As Boolean isHidden = Rows(3).Hidden
Leave a comment:
-
I don't think that you really want a macro. That would wipe out the formula, then if the data changed, you'd want the formula back. Just wrap the formulas in E and F with an IFERROR function.
For example, if E1 contains =SUM(A1:C1)
then change the formula to =IFERROR(SUM(A1 :C1),0)
Then just auto-fill the rest of the rows.Leave a comment:
-
Somewhat the same:
Code:Sub Macro2() ' Determine last row Dim n As Integer, i As Integer n = Cells.SpecialCells(xlCellTypeLastCell).Row ' Copy cells E3:F3 into the odd rows For i = 5 To n Step 2 Range("E" & i & ":F" & i).FormulaR1C1 = Range("E3:F3").FormulaR1C1 Next i End Sub
Leave a comment:
-
Does this do what you want?
Code:Option Explicit Sub Macro1() ' Determine last row Dim n As Integer, i As Integer n = Cells.SpecialCells(xlCellTypeLastCell).Row ' Copy the odd rows to the next row For i = 1 To n Step 2 Rows(i).Copy Rows(i + 1) Next i End Sub
Leave a comment:
-
Did you ever solve this problem? I'm also trying to do it. I'm using VB.Net 2008. Thanks! --SamLeave a comment:
-
Problem solved: in the Format menu, he had accidently set Lock Controls. Thanks! --SamLeave a comment:
No activity results to display
Show More
Leave a comment: