Click here to Skip to main content
15,891,033 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How can I right-align an image inside a picturebox? Pin
Luc Pattyn26-May-10 13:05
sitebuilderLuc Pattyn26-May-10 13:05 
GeneralRe: How can I right-align an image inside a picturebox? Pin
Luc Pattyn26-May-10 13:09
sitebuilderLuc Pattyn26-May-10 13:09 
NewsRe: How can I right-align an image inside a picturebox? Pin
Sonhospa27-May-10 9:54
Sonhospa27-May-10 9:54 
QuestionShow dataset created in own thread in GUI Pin
Johan Hakkesteegt26-May-10 2:58
Johan Hakkesteegt26-May-10 2:58 
AnswerRe: Show dataset created in own thread in GUI Pin
Sonhospa26-May-10 5:53
Sonhospa26-May-10 5:53 
GeneralRe: Show dataset created in own thread in GUI Pin
William Winner26-May-10 13:08
William Winner26-May-10 13:08 
GeneralRe: Show dataset created in own thread in GUI Pin
Johan Hakkesteegt26-May-10 20:56
Johan Hakkesteegt26-May-10 20:56 
QuestionVBA Previous sheet copy Pin
Dalek Dave26-May-10 1:21
professionalDalek Dave26-May-10 1:21 
Below is a small macro wot I just wrote...

I want, at the click of a macro, to create a New Sheet, then to go the previous sheet (ie the one for the previous month) and pick up and copy the framework.

I do not want to pick this sheet up by name, for each month will have a different Carry Forward (CF) value.

So I want to pick up the CF from always the previous months sheet.

I tried Sheets(Sheet.Count(-1)).Select but it is throwing me out at this point.

Any ideas?


Sub NewMonth()
'
' NewMonth Macro
'

' Add sheet
    Sheets.Add After:=Sheets(Sheets.Count)
' Copy previous month
    Sheets(Sheet.Count(-1)).Select
    Columns("A:J").Select
    Selection.Copy
    Sheets("Sheet1").Select
    Range("A1").Select
    ActiveSheet.Paste
' Last months CF
    Range("H40").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "=+Sheets(Sheets.Count(-1)!R[2]C"
' Month Header
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "=TODAY()"
    Range("E1").Select
    Selection.Copy
    Range("E1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    ActiveSheet.Paste
    Application.CutCopyMode = False
End Sub

------------------------------------

I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

AnswerRe: VBA Previous sheet copy Pin
JR21226-May-10 1:52
JR21226-May-10 1:52 
GeneralRe: VBA Previous sheet copy Pin
Dalek Dave26-May-10 3:11
professionalDalek Dave26-May-10 3:11 
GeneralRe: VBA Previous sheet copy Pin
JR21226-May-10 22:56
JR21226-May-10 22:56 
AnswerRe: VBA Previous sheet copy Pin
DaveAuld26-May-10 2:12
professionalDaveAuld26-May-10 2:12 
GeneralRe: VBA Previous sheet copy Pin
Dalek Dave26-May-10 3:12
professionalDalek Dave26-May-10 3:12 
GeneralRe: VBA Previous sheet copy Pin
DaveAuld26-May-10 3:55
professionalDaveAuld26-May-10 3:55 
GeneralRe: VBA Previous sheet copy Pin
Dalek Dave26-May-10 3:59
professionalDalek Dave26-May-10 3:59 
QuestionHow to serialize shared members of a class? Pin
MohammadAmiry26-May-10 0:32
MohammadAmiry26-May-10 0:32 
AnswerRe: How to serialize shared members of a class? Pin
Dave Kreskowiak26-May-10 2:02
mveDave Kreskowiak26-May-10 2:02 
QuestionDatagridview checkbox enter key Pin
C#Coudou25-May-10 15:04
C#Coudou25-May-10 15:04 
AnswerRe: Datagridview checkbox enter key Pin
Dr.Walt Fair, PE25-May-10 15:41
professionalDr.Walt Fair, PE25-May-10 15:41 
GeneralRe: Datagridview checkbox enter key Pin
C#Coudou25-May-10 15:56
C#Coudou25-May-10 15:56 
GeneralRe: Datagridview checkbox enter key Pin
Dr.Walt Fair, PE25-May-10 16:47
professionalDr.Walt Fair, PE25-May-10 16:47 
GeneralRe: Datagridview checkbox enter key [modified] Pin
C#Coudou25-May-10 18:35
C#Coudou25-May-10 18:35 
GeneralRe: Datagridview checkbox enter key Pin
Luc Pattyn25-May-10 18:59
sitebuilderLuc Pattyn25-May-10 18:59 
GeneralRe: Datagridview checkbox enter key Pin
C#Coudou25-May-10 20:33
C#Coudou25-May-10 20:33 
GeneralRe: Datagridview checkbox enter key Pin
Dr.Walt Fair, PE26-May-10 4:51
professionalDr.Walt Fair, PE26-May-10 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.